DataStage Scenario Problem --> DataStage Scenario - Problem4
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 “Company” in ascending order.
c) Transformer Stage Properties
Here, we took 2 stage variable : StageVar, StageVar1, StageVar2
and their derivations are -
StageVar = If StageVar1=DSLink5.Company Then DSLink5.Location:',':StageVar Else DSLink5.Location
StageVar2 = If StageVar1=DSLink5.Company Then StageVar2+1 Else 1
StageVar1 = DSLink5.Company
d) Remove Duplicate Stage Properties
In Remove Duplicate Stage, we will retain the "LAST" record.
e) OutPut File
In Output file, we will get the output as we desired.
IBM,BANGLOORE ,PUNE ,HYDRABAD ,CHENNAI ,4