Process Stuck on Zero Out

Post Reply
Thurston Howell III
Posts: 36
Joined: Fri Mar 10, 2017 8:26 pm
OLAP Product: TM1
Version: PA 2.0.8
Excel Version: 2016
Location: Dallas, TX

Process Stuck on Zero Out

Post by Thurston Howell III »

I have a TI process that deletes the contents of a cube and reloads the data based on a CSV. The process worked until yesterday, when it failed immediately and gave me a "stack overflow error." I deleted the Feeder files and restarted my server hoping to clear up any corrupt Feeders. Now when I run the process it gets stuck indefinitely on the prolog's VIEWZEROOUT. I have replicated the prolog below.

I am not responsible for this cube or the ones it feeds, but the person who owns them insists no rules have changed. Any ideas would be greatly appreciated.

#=============================================================================================
#>>> DEFINE CUBES, VALUES AND DIMENSION ELEMENTS
#=============================================================================================
strCube = 'sunHFM_Comp_Emp_Info';
strScenario = 'Budget';
strZeroNew_g = UPPER( SUBST( TRIM( pZeroNew ), 1, 1 ) );

#==========================================
# DEACTIVATE EMP_INFO RULES
#==========================================
CELLPUTS('Y', '}SunControls', 'Value', 'DeActivate EmpInfo Rules - SUN');


#==========================================
# ZERO OUT ALL ADP DATA
#==========================================

cubFin = strCube;
vewRef = 'zzzSUNZeroOut';
SubRef = vewRef;

#-------------------------------------------------------
#>>> CREATE VIEW FOR ZEROOUT
#-------------------------------------------------------
IF (VIEWEXISTS (cubFin, vewRef) = 1);
VIEWDESTROY (cubFin, vewRef);
ENDIF;
VIEWCREATE (cubFin, vewRef);

#-------------------------------------------------------
#>>> CREATE ZEROOUT SUBSET IN SCENARIO DIMENSION
#-------------------------------------------------------
dimScenario = 'bpmScenario';
strElement = strScenario;

IF (SUBSETEXISTS (dimScenario, subRef) = 0);
SUBSETCREATE (dimScenario, subRef);
ENDIF;

SUBSETDELETEALLELEMENTS (dimScenario, subRef);
SUBSETELEMENTINSERT (dimScenario, subRef, strElement, 1);
VIEWSUBSETASSIGN (cubFin, vewRef, dimScenario, subRef);


#-------------------------------------------------------
#>>> CREATE ZEROOUT SUBSET IN INDEX DIMENSION
#-------------------------------------------------------
dimIndex = 'bpmStaff_Index';
#strElement = strScenario;

IF (SUBSETEXISTS (dimIndex, subRef) = 0);
SUBSETCREATE (dimIndex, subRef);
ENDIF;

SUBSETDELETEALLELEMENTS (dimIndex, subRef);
VIEWSUBSETASSIGN (cubFin, vewRef, dimIndex, subRef);

IF(strZeroNew_g @= 'Y');
strEle = 'Total Employees';
ELSE;
strEle = 'Total Existing';
ENDIF;

p = 1;
WHILE(p <= DIMSIZ(dimIndex));
strLoopEle = DIMNM(dimIndex, p);
IF(ELLEV(dimIndex, strLoopEle) = 0 & ELISANC(dimIndex, strEle, strLoopEle) <> 0);
SUBSETELEMENTINSERT(dimIndex, subRef, strLoopEle, SUBSETGETSIZE(dimIndex, subRef) + 1);
ENDIF;
p = p + 1;
END;


#-------------------------------------------------------
#>>> PERFORM THE ZERO OUT AND DELETE VIEW
#-------------------------------------------------------
VIEWZEROOUT (cubFin, vewRef);

VIEWDESTROY (cubFin, vewRef);
User avatar
gtonkin
MVP
Posts: 1192
Joined: Thu May 06, 2010 3:03 pm
OLAP Product: TM1
Version: Latest and greatest
Excel Version: Office 365 64-bit
Location: JHB, South Africa
Contact:

Re: Process Stuck on Zero Out

Post by gtonkin »

Note sure if it is getting unhappy here:
SUBSETELEMENTINSERT(dimIndex, subRef, strLoopEle, SUBSETGETSIZE(dimIndex, subRef) + 1);

may be worthwhile trying:

Code: Select all

SUBSETELEMENTINSERT(dimIndex, subRef, strLoopEle, 0);
If memory serves, I remember the 0 index adds to the end but you will need to test.

Failing this, try adding some ASCIIOUTPUTs at various places e.g. before the loop, in the loop etc. and see what gets output.

Edit: you may also want to move:
VIEWSUBSETASSIGN (cubFin, vewRef, dimIndex, subRef);
to after the loop i.e. don't assign a blank subset to the view.
User avatar
jim wood
Site Admin
Posts: 3951
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Process Stuck on Zero Out

Post by jim wood »

gtonkin wrote: Fri May 04, 2018 7:19 pm Note sure if it is getting unhappy here:
SUBSETELEMENTINSERT(dimIndex, subRef, strLoopEle, SUBSETGETSIZE(dimIndex, subRef) + 1);

may be worthwhile trying:

Code: Select all

SUBSETELEMENTINSERT(dimIndex, subRef, strLoopEle, 0);
If memory serves, I remember the 0 index adds to the end but you will need to test.

Failing this, try adding some ASCIIOUTPUTs at various places e.g. before the loop, in the loop etc. and see what gets output.

Edit: you may also want to move:
VIEWSUBSETASSIGN (cubFin, vewRef, dimIndex, subRef);
to after the loop i.e. don't assign a blank subset to the view.
You are correct adding at position 0 adds it as the last element in the dimension and much safer than using anything else.
Struggling through the quagmire of life to reach the other side of who knows where.
Shop at Amazon
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
Wim Gielis
MVP
Posts: 3103
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Process Stuck on Zero Out

Post by Wim Gielis »

Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Thurston Howell III
Posts: 36
Joined: Fri Mar 10, 2017 8:26 pm
OLAP Product: TM1
Version: PA 2.0.8
Excel Version: 2016
Location: Dallas, TX

Re: Process Stuck on Zero Out

Post by Thurston Howell III »

Thanks for your help, guys. It was actually a rule based value issue that was preventing the zero out. It works now.
Post Reply