### Check for error in prolog ### If( nErrors > 0 ); ProcessBreak; EndIf; ## INNER LOOP#### ### Determine Customer dimension Substitution ### i2= 1; AsciiOutput( 'Loop Log Data.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 Data.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 Data.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 Data.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'); AsciiOutput( 'Loop Log Data.txt', 'VERSION VALUE', pSourceVersion,pTargetVersion,NumberToString(i3)); ### Break the loop if any of the source or target version not found ### ### Log Info of the innermost loop parameters before the loop breaks## AsciiOutput( 'Loop Log Data.txt', 'BEFORE INNERMOST LOOP BREAK', pCube, pSourceCustomer,pTargetCustomer,pSourceVersion, pTargetVersion,NumberToString(i3),TimSt( Now, '\d-\m-\Y \h:\i:\s' )); If( pSourceVersion @= '' % pTargetVersion @='' ); Break; EndIf; ### Log Info of the innermost loop parameters after the loop breaks## AsciiOutput( 'Loop Log Data.txt', 'AFTER INNERMOST LOOP BREAK', pCube, pSourceCustomer,pTargetCustomer,pSourceVersion, pTargetVersion,NumberToString(i3),v1,v2,v3,v4,TimSt( Now, '\d-\m-\Y \h:\i:\s' )); ### Log Info of the Customer Dimension Index and Target Customer Name## AsciiOutput( 'Loop Log Data.txt', 'DATA- Customer Dimension Index and Target Customer Name ', pCube,NumberToString(nDimensionIndex), pSourceCustomer,pTargetCustomer,pSourceVersion, pTargetVersion,TimSt( Now, '\d-\m-\Y \h:\i:\s' )); AsciiOutput( 'Loop Log Data.txt', 'VARIABLE SUBSTITUTION', pCube,pSourceCustomer,pSourceVersion,NumberToString(nDimensionIndex),NumberToString(nDimensionIndex1), pSourceCustomer,pTargetCustomer,pSourceVersion, pTargetVersion, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,v11,NumberToString(i2),NumberToString(i3),TimSt( Now, '\d-\m-\Y \h:\i:\s' )); ### Write data from source version to target version ### # Selects the correct CellPut formula depending upon the number of dimensions in the cube # and whether the value is numeric or string ( max 27 dims catered for in this code ) # value type determined by element type of last dimension in cube # could have used Value_is_String = 1 and NValue/SValue but this works just as well If( pDebug <= 1 ); If( nDimensionCount = 2 ); If( CellIsUpdateable( pCube, v1, v2 ) = 1 ); sElType = DType( sDim2, v2 ); If( sElType @= 'S' ); CellPutS( v3, pCube, v1, v2 ); Else; CellPutN( Numbr( v3 ), pCube, v1, v2 ); ENDIF; ENDIF; ElseIf( nDimensionCount = 3 ); If( CellIsUpdateable( pCube, v1, v2, v3 ) = 1 ); sElType = DType( sDim3, v3 ); If( sElType @<> 'S' ); CellPutN( Numbr( v4 ), pCube, v1, v2, v3 ); Else; CellPutS( v4, pCube, v1, v2, v3 ); EndIf; EndIf; ElseIf( nDimensionCount = 4 & pCube @='Summary' ); If( CellIsUpdateable( pCube, v1, v2,v3, v4 ) = 1 ); sElType = DType( sDim4, v4 ); If( sElType @= '' ); itemskip; elseIf( sElType @<> 'S' ); CellPutN( Numbr( v5 ), pCube, pTargetCustomer,pTargetVersion, v3, v4 ); Else; CellPutS( v5, pCube, pTargetCustomer,pTargetVersion, v3, v4 ); EndIf; EndIf; ElseIf( nDimensionCount = 4 & pCube @<> 'Summary'); If( CellIsUpdateable( pCube, v1, v2,v3, v4 ) = 1 ); sElType = DType( sDim4, v4 ); If( sElType @= '' ); itemskip; elseIf( sElType @<> 'S' ); CellPutN( Numbr( v5 ), pCube, pTargetCustomer,v2, pTargetVersion, v4 ); Else; CellPutS( v5, pCube, pTargetCustomer,v2, pTargetVersion, v4 ); EndIf; EndIf; ElseIf( nDimensionCount = 5 & pCube @='Summary $' ); If( CellIsUpdateable( pCube, v1, v2, v3, v4, v5 ) = 1 ); sElType = DType( sDim5, v5 ); If( sElType @<> 'S' ); CellPutN( Numbr( v6 ), pCube, pTargetCustomer, pTargetVersion, v3, v4, v5 ); Else; CellPutS( v6, pCube, pTargetCustomer, pTargetVersion, v3, v4, v5 ); EndIf; EndIf; ElseIf( nDimensionCount = 5 & pCube @='MDF' ); If( CellIsUpdateable( pCube, v1, v2, v3, v4, v5 ) = 1 ); sElType = DType( sDim5, v5 ); If( sElType @<> 'S' ); CellPutN( Numbr( v6 ), pCube, pTargetCustomer, v2, pTargetVersion, v4, v5 ); Else; CellPutS( v6, pCube, pTargetCustomer, v2, pTargetVersion, v4, v5 ); EndIf; EndIf; ElseIf( nDimensionCount = 5 & pCube @<>'Summary $' & pCube @<>'MDF'); If( CellIsUpdateable( pCube, v1, v2, v3, v4, v5 ) = 1 ); sElType = DType( sDim5, v5 ); If( sElType @<> 'S' ); CellPutN( Numbr( v6 ), pCube, pTargetCustomer, v2, v3, pTargetVersion, v5 ); Else; CellPutS( v6, pCube, pTargetCustomer, v2, v3, pTargetVersion, v5 ); EndIf; EndIf; ElseIf( nDimensionCount = 6 & pCube @='Rebate Review' ); If( CellIsUpdateable( pCube, v1, v2, v3, v4, v5, v6 ) = 1 ); sElType = DType( sDim6, v6 ); If( sElType @<> 'S' ); CellPutN( Numbr( v7 ), pCube, pTargetCustomer, v2, v3,v4, pTargetVersion, v6 ); Else; CellPutS( v7, pCube, pTargetCustomer, v2, v3, v4, pTargetVersion, v6 ); EndIf; EndIf; ElseIf( nDimensionCount = 6 & pCube @<>'Rebate Review' ); If( CellIsUpdateable( pCube, v1, v2, v3, v4, v5, v6 ) = 1 ); sElType = DType( sDim6, v6 ); If( sElType @<> 'S' ); CellPutN( Numbr( v7 ), pCube, pTargetCustomer, v2, v3,pTargetVersion, v5, v6 ); Else; CellPutS( v7, pCube, pTargetCustomer, v2, v3, pTargetVersion, v5, v6 ); EndIf; EndIf; ElseIf( nDimensionCount = 7 ); If( CellIsUpdateable( pCube, v1, v2, v3, v4, v5, v6, v7 ) = 1 ); sElType = DType( sDim7, v7 ); If( sElType @<> 'S' ); CellPutN( Numbr( v8 ), pCube, v1, v2, v3, v4, v5, v6, v7 ); Else; CellPutS( v8, pCube, v1, v2, v3, v4, v5, v6, v7 ); EndIf; EndIf; ElseIf( nDimensionCount = 8 ); If( CellIsUpdateable( pCube, v1, v2, v3, v4, v5, v6, v7, v8 ) = 1 ); sElType = DType( sDim8, v8 ); If( sElType @<> 'S' ); CellPutN( Numbr( v9 ), pCube, v1, v2, v3, v4, v5, v6, v7, v8 ); Else; CellPutS( v9, pCube, v1, v2, v3, v4, v5, v6, v7, v8 ); EndIf; EndIf; ElseIf( nDimensionCount = 9 ); If( CellIsUpdateable( pCube, v1, v2, v3, v4, v5, v6, v7, v8, v9 ) = 1 ); sElType = DType( sDim9, v9 ); If( sElType @<> 'S' ); CellPutN( Numbr( v10 ), pCube, v1, v2, v3, v4, v5, v6, v7, v8, v9 ); Else; CellPutS( v10, pCube, v1, v2, v3, v4, v5, v6, v7, v8, v9 ); EndIf; EndIf; ElseIf( nDimensionCount = 10 ); If( CellIsUpdateable( pCube, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10 ) = 1 ); sElType = DType( sDim10, v10 ); If( sElType @<> 'S' ); CellPutN( Numbr( v11 ), pCube, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10 ); Else; CellPutS( v11, pCube, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10 ); EndIf; EndIf; EndIf; EndIf; ### Log Info of the Cube Dimension count and Customer dimension Substitution## AsciiOutput( 'Loop Log Data.txt', 'DATA-AFTER CUSTOMER SUBSTITUTION', pCube,NumberToString(nDimensionCount),pSourceCustomer,pTargetCustomer,pSourceVersion, pTargetVersion,v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,v11,NumberToString(i2),NumberToString(i3),TimSt( Now, '\d-\m-\Y \h:\i:\s' )); ### Log Info of the Cube Dimension count and Version dimension Substitution## AsciiOutput( 'Loop Log Data.txt', 'DATA-AFTER VERSION SUBSTITUTION', pCube,NumberToString(nDimensionCount1),pSourceCustomer,pTargetCustomer,pSourceVersion, pTargetVersion,v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,v11,NumberToString(i2),NumberToString(i3),TimSt( Now, '\d-\m-\Y \h:\i:\s' )); i3 =i3+1; AsciiOutput( 'Loop Log Data.txt', ' INNERMOST LOOP INCREMENT', pCube, NumberToString(i3), TimSt( Now, '\d-\m-\Y \h:\i:\s' )); end; AsciiOutput( 'Loop Log Data.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 Data.txt', ' INNER LOOP INCREMENT', pCube, NumberToString(i2), TimSt( Now, '\d-\m-\Y \h:\i:\s' )); end; AsciiOutput( 'Loop Log Data.txt', ' INNER LOOP END', pCube, NumberToString(i2), TimSt( Now, '\d-\m-\Y \h:\i:\s' )); ## END OF INNER LOOP#### ### End Data ###