Need to merge 3 files having different no of columns

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
Jagan617
Participant
Posts: 42
Joined: Thu Jun 05, 2008 7:37 pm

Need to merge 3 files having different no of columns

Post by Jagan617 »

Hi,

I am using Datastage 7.5.3 server edition on windows platform. I need to merge 3 files into 1 file i.e., Header file, footer file and data file which has got different number of columns. Could anyone assist me in this.
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

Can't you merge 1 + 2 based on keys x_y_z, then merge 3 to 1_2 based upon the same keys?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Move to the actual Server forum.

Do your "header" and "footer" files contain a single row apiece? Or do you have multiple entries in each that need to be merged with the rows in the data file? For the former, the DOS copy command can do the trick for you:

Code: Select all

COPY HEADER+DATA+FOOTER COMBO
You literally put the three filenames together with plus signs and then the new target table it will create after that. Of course, my example has relative paths, in reality you'll either need to "cd" there first or use absolute paths for all of them.

Now, if you need to do the "merge" thing, that's a whole 'nuther kettle of fish.
-craig

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