Join Files which is not having key column

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
rakesh.nc
Participant
Posts: 39
Joined: Wed Aug 01, 2007 5:10 am
Location: Chennai

Join Files which is not having key column

Post by rakesh.nc »

hi all,


I need to join two files, file1 contain col1 and file2 contain col2, i need an output in such a way that the output file should contain col1 | col2 seperately but in a one file.
regards,
Rakesh
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use Column Generator stages to create a sequential key column on each input. Feed those into a Join stage. Direct the output of that into a two-column text file.
Last edited by ray.wurlod on Tue Feb 12, 2008 2:47 am, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
AmeyJoshi14
Participant
Posts: 334
Joined: Fri Dec 01, 2006 5:17 am
Location: Texas

Post by AmeyJoshi14 »

:idea: You can use dummy column to join the two files.....
Add this column in both the file..say the name of the column is colX with value as '1'. Us join stage which will join the records based on this dummy column..
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

AmeyJoshi14 wrote::idea: You can use dummy column to join the two files.....
Add this column in both the file..say the name of the column is colX with value as '1'. Us join stage which will join the records based on this dummy column..
dummy column may lead to cross product

its better to use Ray's suggestion if number of records are more than 1
.

or pass the row number from transformer and join on row number

Regards,
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
Post Reply