Page 1 of 1

group and create sequence..is it possible in DataStage

Posted: Tue Feb 13, 2007 4:40 pm
by Smeitei
Scenario.

i have 3 fields coming in as an input say( ID, Name, Age). And i want to introduce one field call "Indicator".

Now if i have duplicate combinationcoming in the output should look like

ID Name Age Indicator
1 Surjit 25 1
1 Surjit 25 2
1 Surjit 25 3
2 XYZ 26 1
2 XYZ 26 2
3 rty 34 1
3 rty 34 2

the output should be such that there should be a generated sequence number for each unique grouping of (ID,Name and Age)

Is it possible in dataStage

Posted: Tue Feb 13, 2007 5:07 pm
by narasimha
It is possible.
Very similar situations have been dealt with before. Do a search, if you don't find any, get back.

Posted: Tue Feb 13, 2007 6:07 pm
by kumar_s
What are the inputs?
How the field Indicator is decided upon? ie., how the cound 1,2,3 or 1,2 is decided?
Answer for this vary with respect to your reply.

Posted: Tue Feb 13, 2007 7:26 pm
by ray.wurlod
Use sorted (by ID) input and stage variables to detect change and increment/reset sequence number.

Posted: Tue Feb 13, 2007 8:40 pm
by DSguru2B
Hereis a similar post.