COGNOiSe.com - The IBM Cognos Community

Planning & Consolidation => TM1 => Topic started by: donap on 14 Dec 2017 10:53:34 AM

Title: "Goto" type functionality in TI process ?
Post by: donap on 14 Dec 2017 10:53:34 AM
I have a large (approx 4,000 lines of code) TI process, but if one of the input (data source) variables is a certain value, I want to skip a large block of the code.  I know I can do this with an IF-ENDIF but I do not really want to have 2,000 lines of code inside of the IF-ENDIF block.
The remaining code needs to be executed in FOR ALL input rows, so there is no ELSE part of this logic.
Thanks
Sample -

if vTest_value @<> 'A';
   #== do a whole bunch of stuff -- approx 2,000 lines of code
endif;

#==== do everything else for ALL values of vTest_Value
....
....
...



Title: Re: "Goto" type functionality in TI process ?
Post by: AJAYC on 16 Dec 2017 09:59:44 AM
There is no GOTO function, however I like to split this out. If you've got code of about 2000 lines, I'd keep these in another process, so have something like this:



# Process01 applies to all values of vTest_value
#===================================
ExecuteProcess ( "process01".........) ;


# Process02 applies to all values except 'A' of vTest_value
#===================================
IF ( vTest_value @<> 'A' );
     ExecuteProcess ( "process02".........) ;
ENDIF ;


The two processes called represent the what you wish to happen.
HTH
Ajay


Title: Re: "Goto" type functionality in TI process ?
Post by: donap on 18 Dec 2017 08:17:44 AM
Thank you.


Never thought to do that -- but that makes so much sense.