Originally posted by: SystemAdmin
It is possible to perform multiple key sorts using DataStage TX so there should be no reason you can't sort on column two of your records. Multiple key sorts were discussed here on the forum in March of 2002. The solution I suggested at that time requires you define Fields (s) as a component of Records (s). The map takes the input file:
04,Abe
07,Dick
01,Abe
03,Carol
02,Carol
10,Dick
10,Abe
10,Carol
07,Abe
and produces the output file:
01,Abe
02,Carol
03,Carol
04,Abe
07,Abe
07,Dick
10,Abe
10,Carol
10,Dick
Now why those blank lines occur I don't recall but I'm sure they can be eliminated.
The nested functional map rules are:
=SortOnField1(SORTUP(UNIQUE(Field[1]:Record:Input)), Input)
=SortOnField2(SORTUP(UNIQUE(Field[2]:Record:Input)), ID, Input)
=EXTRACT(Record:Input, Field[2]:Record:Report:Input = Name & Field[1]:Record:Input = ID)
For your requirement, I believe you would only need the second FMap and the third FMap without the Second condition.
#IBM-Websphere-Transformation-Extender#IBMSterlingTransformationExtender#DataExchange