DataStage Scenario Problem --> DataStage Scenario - Problem5
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 Sort and Transformer stage to achieve the output.
b) Sort Stage Properties
In Sort stage, we will sort the data based on column “Char” in ascending order.
In Sort stage, we will sort the data based on column “Char” in ascending order.
c) Transformer Stage Properties
Here, we took 2 stage variable : StageVar, StageVar1, StageVar2
and their derivations are -
StageVar = If StageVar1=DSLink6.Char Then StageVar+1 Else1
StageVar1 = DSLink6.Char
Create a new column in output which contains the Occurrence of characters and assigned the StageVar.
Occurrence = StageVar
e) OutPut File
In Output file, We will use the in-line sorting to sort the data on "Occurrence" column in ascending order.
no, char, occurrence
1,a,1
3,a,2
5,a,3
6,a,4
8,a,5
2,b,1
4,b,2
7,b,3
3,a,2
5,a,3
6,a,4
8,a,5
2,b,1
4,b,2
7,b,3
No comments :
Post a Comment