Compare 2 Lists of Values

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
thebird
Participant
Posts: 254
Joined: Thu Jan 06, 2005 12:11 am
Location: India
Contact:

Compare 2 Lists of Values

Post by thebird »

I need to compare 2 comma separated lists of values - say
List 1 - 110,123,132,144
List2 - 1004,1005,123,1007
I would like to find out if any of the values in List1 is present in List2.

How can I go about doing this?

Infact,all the values in the lists are coming as individual records from the source -
Col1 Col2
110 1004
123 1005
132 123
144 1007
During my process i create the lists - but now I need to figure out if any of the values of List1 are available in List2 and only if they are present then output a row.

Help appreciated.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

You can use the Join stage, lookup stage and a few others. You said output a row, which column is going to decide that, the first column or the second column? Never the less you can create two datasets and do a lookup keyed on 1st column for one dataset and 2nd for its copy. Depending upon the driver column you will specify the rules.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply