Page 1 of 1

Process: ASCII Loaded Twice

Posted: Tue Dec 30, 2008 7:14 pm
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');

Re: Process: ASCII Loaded Twice

Posted: Tue Dec 30, 2008 7:20 pm
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

Re: Process: ASCII Loaded Twice

Posted: Tue Dec 30, 2008 9:28 pm
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.

Re: Process: ASCII Loaded Twice

Posted: Tue Dec 30, 2008 10:54 pm
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.

Re: Process: ASCII Loaded Twice

Posted: Wed Dec 31, 2008 3:55 am
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...

Re: Process: ASCII Loaded Twice

Posted: Fri Jan 02, 2009 12:02 pm
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.

Re: Process: ASCII Loaded Twice

Posted: Tue Jan 06, 2009 3:33 pm
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 :) )