Flattening the file with codes

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
pradkumar
Charter Member
Charter Member
Posts: 393
Joined: Wed Oct 18, 2006 1:09 pm

Flattening the file with codes

Post by pradkumar »

Hi

I am having a source input file as
Input
Name Region
Ravi All
Ram Europe


I am having a table which is having structure and data as below:
C1 C2 C3
A Asia 10
B Asia 20
C Europe 30


Now I want to map the input file to this table and get all the codes for the corresponding region and expecting output to be as
Output

Name Region Code
Ravi All 10
Ravi All 20
Ravi All 30
Ram Europe 30

As Ravi is assigned All in the osurce file, he should get all the codes.I tried using lookup, but lookup only gets only one value
Please share any ideas on this

Thanks
Pradeep
Pradeep Kumar
satya99
Participant
Posts: 104
Joined: Thu Nov 30, 2006 1:22 pm

Post by satya99 »

Pradeep,

How does the design look like.
What are the keys.
Is source a hashed file.
Based on which key, you are performing join.

Thanks
satya
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If you want the lookup to return multiple records, you'll need to use either a UV stage or an ODBC stage for the looking upping.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You will need special handling for "All" - probably in a separate stream in the job that you can bring back together with the main stream in a Link Collector stage or by writing to an intermediate hashed file.
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