DataStage Scenario Problem --> DataStage Scenario - Problem7
Solution Design :
a) Job Design : Below is the design which can achieve the output as we needed. Here, we are reading seq file as a input, then data is passing through a Transformer and Peek stage to achieve the output.
b) Transformer Stage PropertiesStage will run SEQUENTIALLY.
The logic here is - give a seq no of each 3 rows so that we can do vertical pivot on that. For that we will use 3 stage variable which derivation is as :
svCntr+1 = svCntr
svIncmt = svPivot
If mod(svCntr,3)=0Then svIncmt+1 Else svPivot = svIncmt
and use below column derivation :
In_xfm.col = col
svPivot = PivotCol
First stage variable (svCntr) is increment by 1 for each input row starting from 1. Second stage variable svPivot is assigned to PivotCol. The third stage variable is counting the input rows, when it is equal to multiple of 3, it increment the svIncmt by 1. By this we will get the output like..
b) Pivot Stage Properties
Stage will run SEQUENTIALLY.
Now, we have to use Vertical Pivoting on Col. Group by "PivotCol" , Put Array Size to 3.
Now, Map the column to output file and compile the job.
For More ---> VISIT THIS LINK