Retreive reference records from lookup

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
hemaarvind1
Participant
Posts: 50
Joined: Mon Jan 21, 2008 9:35 am

Retreive reference records from lookup

Post by hemaarvind1 »

Hi Everyone,

Greetings!

we are have two files file1 and file2.
Our requirement is to compare these two files and give the below outputs:

If the records match, give the output from file2.
If the records do not match,give the output from file1.

Could you please suggest a way to achieve this.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Do you need to handle records missing from one file or the other? Meaning they exist in File1 but not File2 or vice versa...
-craig

"You can never have too many knives" -- Logan Nine Fingers
hemaarvind1
Participant
Posts: 50
Joined: Mon Jan 21, 2008 9:35 am

Post by hemaarvind1 »

Thank you for immediate reply. Please assume that file1 is source file and file2 is the reference file.the scenario is such that the record may be present in source and reference files as well.this is not the case of missing files.if the record is present in reference file,irrespective of source file, the record should be loaded from reference file.if the record is not available in reference file then only we have to load the file from source.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Full outer join in Join stage, filter using IsNotNull() function.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yes, that would be the full service solution. That would allow you to check for differences and/or 'missing' records from either side via null checks as Ray notes.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply