Process: ASCII Loaded Twice

Post Reply
User avatar
Eric
MVP
Posts: 373
Joined: Wed May 14, 2008 1:21 pm
OLAP Product: TM1
Version: 9.4
Excel Version: 2003
Location: Chicago, IL USA

Process: ASCII Loaded Twice

Post by Eric »

Very odd occurrence.

I have a chore that is a simple process that loads an ASCII file. It has been running for 20+ days perfectly. Then it botched the job, by loading the ASCII file two times. I reviewed the logs and the process was only executed one time. I didn't find anything wrong, and could not duplicate the error. Ran fine for a few more days and messed up again today! :evil:

I can only guess that the data tab is somehow being executed two time, but can't think of any reason why or how. Anyone else have any thoughts?

Prolog:

Code: Select all

Record_Count=0;
Meta:

Code: Select all

Day_v='';
Month_v='';
PPC_Rebate_n=0;
Units_n=0;
Standard_Cost_n=0;

Month_v=SubST(Posting_Date,1,2);
Day_v=SubST(Posting_Date,4,2);
PPC_Rebate_n=IF(SUBST(PPC_Rebate,LONG(PPC_Rebate),1)@='-',-NUMBR(SUBST(PPC_Rebate,1,LONG(PPC_Rebate)-1)),NUMBR(PPC_Rebate));
Units_n=IF(SUBST(Units,LONG(Units),1)@='-',-NUMBR(SUBST(Units,1,LONG(Units)-1)),NUMBR(Units));
Standard_Cost_n=IF(SUBST(Standard_Cost,LONG(Standard_Cost),1)@='-',-NUMBR(SUBST(Standard_Cost,1,LONG(Standard_Cost)-1)),NUMBR(Standard_Cost));

Data:

Code: Select all

Day_v='';
Month_v='';
PPC_Rebate_n=0;
Units_n=0;
Standard_Cost_n=0;

Record_Count=Record_Count  +  1;

IF(Material_Number@='721566-04');
     ItemSkip;
ELSEIF(Material_Number@='8000360');
     ItemSkip;
ENDIF;


Month_v=SubST(Posting_Date,1,2);
Day_v=SubST(Posting_Date,4,2);
PPC_Rebate_n=IF(SUBST(PPC_Rebate,LONG(PPC_Rebate),1)@='-',-NUMBR(SUBST(PPC_Rebate,1,LONG(PPC_Rebate)-1)),NUMBR(PPC_Rebate));
Units_n=IF(SUBST(Units,LONG(Units),1)@='-',-NUMBR(SUBST(Units,1,LONG(Units)-1)),NUMBR(Units));
Standard_Cost_n=IF(SUBST(Standard_Cost,LONG(Standard_Cost),1)@='-',NUMBR(SUBST(Standard_Cost,1,LONG(Standard_Cost)-1)),-NUMBR(Standard_Cost));


CellPutN(CellGetN('Daily Sales',Trim(Material_Number),Company_Code,Month_v,Day_v,'Wholesale')  +  Wholesale,'Daily Sales',Trim(Material_Number),Compan
y_Code,Month_v,Day_v,'Wholesale');
CellPutN(CellGetN('Daily Sales',Trim(Material_Number),Company_Code,Month_v,Day_v,'Hospital')  +  Hospital,'Daily Sales',Trim(Material_Number),Company_
Code,Month_v,Day_v,'Hospital');
CellPutN(CellGetN('Daily Sales',Trim(Material_Number),Company_Code,Month_v,Day_v,'Contract')  +  Contract,'Daily Sales',Trim(Material_Number),Company_
Code,Month_v,Day_v,'Contract');
CellPutN(CellGetN('Daily Sales',Trim(Material_Number),Company_Code,Month_v,Day_v,'Misc')  +  Miscellaneous,'Daily Sales',Trim(Material_Number),Company
_Code,Month_v,Day_v,'Misc');
CellPutN(CellGetN('Daily Sales',Trim(Material_Number),Company_Code,Month_v,Day_v,'Chargeback')  +  (Chargeback*-1),'Daily Sales',Trim(Material_Number)
,Company_Code,Month_v,Day_v,'Chargeback');
CellPutN(CellGetN('Daily Sales',Trim(Material_Number),Company_Code,Month_v,Day_v,'Cash Discount')  +  (Cash_Discount*-1),'Daily Sales',Trim(Material_N
umber),Company_Code,Month_v,Day_v,'Cash Discount');
CellPutN(CellGetN('Daily Sales',Trim(Material_Number),Company_Code,Month_v,Day_v,'Rebate')  +  (Rebate*-1),'Daily Sales',Trim(Material_Number),Company
_Code,Month_v,Day_v,'Rebate');
CellPutN(CellGetN('Daily Sales',Trim(Material_Number),Company_Code,Month_v,Day_v,'Return')  +  (Return*-1),'Daily Sales',Trim(Material_Number),Company
_Code,Month_v,Day_v,'Return');
CellPutN(CellGetN('Daily Sales',Trim(Material_Number),Company_Code,Month_v,Day_v,'PPC Rebate')  +  (PPC_Rebate_n),'Daily Sales',Trim(Material_Number),
Company_Code,Month_v,Day_v,'PPC Rebate');
CellPutN(CellGetN('Daily Sales',Trim(Material_Number),Company_Code,Month_v,Day_v,'Units')  +  Units_n,'Daily Sales',Trim(Material_Number),Company_Code
,Month_v,Day_v,'Units');
CellPutN(CellGetN('Daily Sales',Trim(Material_Number),Company_Code,Month_v,Day_v,'COGS')  +  Standard_Cost_n,'Daily Sales',Trim(Material_Number),Compa
ny_Code,Month_v,Day_v,'COGS');
Regards,
Eric
Blog: http://tm1-tipz.blogspot.com
Articles: http://www.google.com/reader/shared/use ... /label/TM1


Production: 32 bit 9.0 SP2, Windows 2000 Advanced Server. Web: 32 bit 9.0 SP2, Windows 2000 Server. Excel 2003
User avatar
Mike Cowie
Site Admin
Posts: 482
Joined: Sun May 11, 2008 7:07 pm
OLAP Product: IBM TM1/PA, SSAS, and more
Version: Anything thru 11.x
Excel Version: 2003 - Office 365
Location: Alabama, USA
Contact:

Re: Process: ASCII Loaded Twice

Post by Mike Cowie »

Eric,

I haven't seen anything like a Data tab being processed twice, but thinking about it from an alternative perspective, do you have a separate VIEWZEROOUT step that is failing? In other words, is the problem not that the file is being processed twice but that it's prior processing is not being cleared out on the next import? I think you should be able to test for this in cube logging by honing in on a particular cell in the cube and seeing if the zero out is happening or if the load + doubling up is happening during the process. Just a thought...

Regards,
Mike
Mike Cowie
QueBIT Consulting, LLC

Are you lost without Print Reports in Planning Analytics for Excel (PAfE)? Get it back today, for free, with Print Reports for IBM Planning Analytics for Excel!
Marcus Scherer
Community Contributor
Posts: 126
Joined: Sun Jun 29, 2008 9:33 am
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2016
Location: Karlsruhe

Re: Process: ASCII Loaded Twice

Post by Marcus Scherer »

The data tab doesn't execute twice. One possible error may be double content of the source file in question. You said it only happens from time to time so it may be a problem outside TM1.

M.
User avatar
Eric
MVP
Posts: 373
Joined: Wed May 14, 2008 1:21 pm
OLAP Product: TM1
Version: 9.4
Excel Version: 2003
Location: Chicago, IL USA

Re: Process: ASCII Loaded Twice

Post by Eric »

That was one of the first guesses, should have mentioned that as well. I have backup of all the source files, and have checked. Nothing is duplicated there.

Will look at it tomorrow. I will keep everyone posted.
Regards,
Eric
Blog: http://tm1-tipz.blogspot.com
Articles: http://www.google.com/reader/shared/use ... /label/TM1


Production: 32 bit 9.0 SP2, Windows 2000 Advanced Server. Web: 32 bit 9.0 SP2, Windows 2000 Server. Excel 2003
User avatar
Alan Kirk
Site Admin
Posts: 6606
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Process: ASCII Loaded Twice

Post by Alan Kirk »

Eric wrote:That was one of the first guesses, should have mentioned that as well. I have backup of all the source files, and have checked. Nothing is duplicated there.

Will look at it tomorrow. I will keep everyone posted.
I can't buy the data tab running twice either; not in 9.0. If that were possible I think someone would have encountered it by now.

My thoughts were along the same lines as the ones already raised; an absence of a ViewZeroOut or the data repeating in the source file.

In the absence of that I'd suggest writing your Record_Count variable to a log file in the Epilog; use a filename which includes a time stamp so that it won't overwrite any earlier files. If the data really is processed twice, the count will be 2 * the number of source records. If it's not, it has to be something else.

Also, this isn't germane to the question, but why are you doing that translation in the MetaData tab when you aren't doing anything with those values? It'll just slow you up.

You, um, AREN'T doing anything with those values, are you? That IS the WHOLE of the code in the Metadata tab? Because of course if the CellPutN code was also in the Metadata tab, then...

Ooh, almost 3pm... time to head to the golf course.

Annual leave... I could get to like this...
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
User avatar
Eric
MVP
Posts: 373
Joined: Wed May 14, 2008 1:21 pm
OLAP Product: TM1
Version: 9.4
Excel Version: 2003
Location: Chicago, IL USA

Re: Process: ASCII Loaded Twice

Post by Eric »

:twisted: :twisted: :twisted:
What a way to waste a few hours! The Noob here set changed the chore and launched it twice. The chore runs multiple processes using my "shell" process, so it made it a little more difficult to find. Guess I should have checked there a bit more thoroughly the first time. Also need to makde sure I am aware of all changes to the chores.

Wished edits to chores were logged in 9.0.
Regards,
Eric
Blog: http://tm1-tipz.blogspot.com
Articles: http://www.google.com/reader/shared/use ... /label/TM1


Production: 32 bit 9.0 SP2, Windows 2000 Advanced Server. Web: 32 bit 9.0 SP2, Windows 2000 Server. Excel 2003
User avatar
Steve Vincent
Site Admin
Posts: 1054
Joined: Mon May 12, 2008 8:33 am
OLAP Product: TM1
Version: 10.2.2 FP1
Excel Version: 2010
Location: UK

Re: Process: ASCII Loaded Twice

Post by Steve Vincent »

be careful what you wish for, for it may come true (and create one massive log file that is completely bloated and dangerously easy to misread. Oh, hello v9.4 :) )
If this were a dictatorship, it would be a heck of a lot easier, just so long as I'm the dictator.
Production: Planning Analytics 64 bit 2.0.5, Windows 2016 Server. Excel 2016, IE11 for t'internet
Post Reply