Rank and Priority in a Job

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Nagasudheerkumar
Premium Member
Premium Member
Posts: 55
Joined: Tue Apr 24, 2007 1:26 am

Rank and Priority in a Job

Post by Nagasudheerkumar »

I have a Scenario:

Code: Select all

Input(text file):
ID  VALUE   CODE 
01    1000   DED
01    1000   DED
01    1000   DEP
01    1000   DEP
01    1000   INN
01    1000   INN
02    2000   INN
02    2000   DEP
02    2000   INN
02    2000   DEP
03    3000   INN
03    3000   INN
04    4000   DED
04    4000   DED

Output(table):
ID    VALUE   CODE
01    1000     DEP 
02    2000     DEP
03    3000     INN
04    4000     DED
Output should be DEP, if DEP is not there then INN, last Priority should be DED.
There are 5000 records which have duplicates like this, can anybody let me know how to accomplish this logic.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Rather than rely on us to spoon-feed you a solution, please suggest what YOU have tried, and allow us to guide you.

There are probably several solutions - I would tend to one that encoded the CODE field into a sortable value, sort by that value, then use a Remove Duplicates stage. Paying close attention, of course, to correct partitioning.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply