Page 1 of 1

Process Stuck on Zero Out

Posted: Fri May 04, 2018 4:22 pm
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);

Re: Process Stuck on Zero Out

Posted: Fri May 04, 2018 7:19 pm
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.

Re: Process Stuck on Zero Out

Posted: Fri May 04, 2018 9:05 pm
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.

Re: Process Stuck on Zero Out

Posted: Sat May 05, 2018 6:17 am
by Wim Gielis

Re: Process Stuck on Zero Out

Posted: Mon May 07, 2018 7:43 pm
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.