Page 1 of 1

Need to merge 3 files having different no of columns

Posted: Mon Nov 07, 2011 4:42 pm
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.

Posted: Mon Nov 07, 2011 5:43 pm
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?

Posted: Mon Nov 07, 2011 6:28 pm
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.