#****Begin: Generated Statements*** AsciiOutput( 'Loop Log Epilog.txt', 'BEFORE TARGET VIEW AND SUBSET DELETE ', pCube, cTempViewFrom, cTempSubFrom, TimSt( Now, '\d-\m-\Y \h:\i:\s' )); ### Initialise Debug ### If( pDebug >= 1 ); # Set debug file name sDebugFile = cDebugFile | 'Epilog.debug'; EndIf; ## INNER LOOP#### ### Determine Customer dimension Substitution ### i2= 1; AsciiOutput( 'Loop Log Epilog.txt', 'BEGIN INNER LOOP', pCube,NumberToString(i2),TimSt( Now, '\d-\m-\Y \h:\i:\s' )); while (i2 <=50); pDim = 'p_Parameters'; Param1 = Dimnm(pDim, i2); pSourceCustomer = CellGetS('Customer Control Cube',Param1,'Source Customer'); pTargetCustomer = CellGetS('Customer Control Cube',Param1,'Target Customer'); ### Break the loop if any of the source or target customer not found ### ### Log Info of the inner loop parameters before the loop breaks## AsciiOutput( 'Loop Log Epilog.txt', 'BEFORE INNER LOOP BREAK', pCube, pSourceCustomer,pTargetCustomer,NumberToString(i2),TimSt( Now, '\d-\m-\Y \h:\i:\s' )); If( pSourceCustomer @= '' % pTargetCustomer @= ''); Break; EndIf; ### Log Info of the inner loop parameters after the loop breaks## AsciiOutput( 'Loop Log Epilog.txt', 'AFTER INNER LOOP BREAK', pCube, pSourceCustomer,pTargetCustomer,NumberToString(i2),TimSt( Now, '\d-\m-\Y \h:\i:\s' )); ## INNERMOST LOOP#### ### Determine version dimension Substitution ### i3 =1; AsciiOutput( 'Loop Log Epilog.txt', 'BEGIN INNERMOST LOOP', pCube,NumberToString(i3),TimSt( Now, '\d-\m-\Y \h:\i:\s' )); while(i3<=10); pDim1 = 'p_Parameters_Version'; Param2 = Dimnm(pDim1,i3); pSourceVersion = CellGetS('Version Control Cube',Param2,'Source Version'); pTargetVersion = CellGetS('Version Control Cube',Param2,'Target Version'); ### Break the loop if any of the source or target version not found ### ### Log Info of the innermost loop parameters before the loop breaks## If( pSourceVersion @= '' % pTargetVersion @='' ); Break; EndIf; ### Log Info of the innermost loop parameters after the loop breaks## IF( nErrors = 0 & pDebug <= 1 ); ### Zero out source data ### If( pZeroSource = 1 ); ViewZeroOut( pCube, cTempViewFrom ); IF( pDebug >= 1 ); sMsg = 'Zero out source data.'; AsciiOutput( sDebugFile, sMsg ); ENDIF; EndIf; EndIf; ### Destroy temporary views and susbsets ### IF( pDestroyTempObj > 0 ); IF( pDebug >= 1 ); sMsg = 'Destroy Tempory Objects: Mode: ' | NumberToString ( pDestroyTempObj ); AsciiOutput( sDebugFile, sMsg ); ENDIF; AsciiOutput( 'Loop Log Epilog.txt', 'BEFORE TARGET VIEW AND SUBSET DELETE ', pCube, cTempViewFrom, cTempSubFrom, TimSt( Now, '\d-\m-\Y \h:\i:\s' )); ## Destroy temporary source view. nRet = ExecuteProcess('Bedrock.Cube.ViewAndSubsets.Delete', 'pCube', pCube, 'pView', cTempViewFrom, 'pSubset', cTempViewFrom, 'pMode', pDestroyTempObj, 'pDebug', pDebug); AsciiOutput( 'Loop Log Epilog.txt', 'AFTER TARGET VIEW AND SUBSET DELETE ', pCube, cTempViewFrom, cTempSubFrom, pSourceVersion, pTargetVersion, NumberToString(pDebug), TimSt( Now, '\d-\m-\Y \h:\i:\s' )); IF( pDebug >= 1 ); sMsg = 'Temporary objects destroyed: Source View. Process End State: ' | NumberToString ( nRet ) ; AsciiOutput( sDebugFile, sMsg ); ENDIF; IF( pZeroTarget = 1 ); ## Destroy temporary target view. AsciiOutput( 'Loop Log Epilog.txt', 'BEFORE TARGET VIEW AND SUBSET DELETE ', pCube, cTempViewTo, cTempSubTo, pSourceVersion, pTargetVersion, TimSt( Now, '\d-\m-\Y \h:\i:\s' )); nRet = ExecuteProcess('Bedrock.Cube.ViewAndSubsets.Delete', 'pCube', pCube, 'pView', cTempViewTo, 'pSubset', cTempSubTo , 'pMode', pDestroyTempObj, 'pDebug', pDebug); AsciiOutput( 'Loop Log Epilog.txt', 'AFTER TARGET VIEW AND SUBSET DELETE ', pCube, cTempViewTo, cTempSubTo, TimSt( Now, '\d-\m-\Y \h:\i:\s' )); IF( pDebug <= 1 ); sMsg = 'Temporary objects destroyed: Target View. Process End State: ' | NumberToString ( nRet ) ; AsciiOutput( sDebugFile, sMsg ); ENDIF; ENDIF; ENDIF; ### Finalise Debug ### If( pDebug >= 1 ); ### Log errors If( nErrors <> 0 ); AsciiOutput( sDebugFile, 'Errors Occurred' ); EndIf; ### Log finish time AsciiOutput( sDebugFile, 'Process Finished: ' | TimSt( Now, '\d-\m-\Y \h:\i:\s' ) ); EndIf; ### If errors occurred terminate process with a major error status ### If( nErrors <> 0 ); ProcessQuit; EndIf; i3 =i3+1; AsciiOutput( 'Loop Log Epilog.txt', ' INNERMOST LOOP INCREMENT', pCube, NumberToString(i3), TimSt( Now, '\d-\m-\Y \h:\i:\s' )); end; AsciiOutput( 'Loop Log Epilog.txt', ' INNERMOST LOOP END', pCube, NumberToString(i3), TimSt( Now, '\d-\m-\Y \h:\i:\s' )); ## END OF INNERMOST LOOP#### i2 =i2+1; AsciiOutput( 'Loop Log Epilog.txt', ' INNER LOOP INCREMENT', pCube, NumberToString(i2), TimSt( Now, '\d-\m-\Y \h:\i:\s' )); end; AsciiOutput( 'Loop Log Epilog.txt', ' INNER LOOP END', pCube, NumberToString(i2), TimSt( Now, '\d-\m-\Y \h:\i:\s' )); ## END OF INNER LOOP#### ### End Epilog ###