Dropping Columns off a sequential file

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
wjfitzgerald
Participant
Posts: 72
Joined: Tue Feb 05, 2008 4:38 am

Dropping Columns off a sequential file

Post by wjfitzgerald »

Hi,

I need to drop a number of fields off each record in a file and be left with the new format under the old file name.

eg input file is called ext/file1 and has four columns, after the process drop 2 colums, i still have a file called ext/file1 with just the two remaining fields.

I have no idea how to keep the file name, or if this is even possible.

As usual, any suggestions would be gratefully recieved, thanks in advance.
Regards,

John Fitz
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You need to write the truncated output to a 2nd file, then use an after-job routine to call the UNIX "mv -f /path/ext/file2 /path/ext/file1"
wjfitzgerald
Participant
Posts: 72
Joined: Tue Feb 05, 2008 4:38 am

Post by wjfitzgerald »

thanks for that, i will look into that straight away.
Could i ask one further question, if i am using a file pattern to read in the file, is there any way to pass out the file name to the unix command, or am i really over complicating the issue at this point?

Thanks again,

john fitz
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Each column in the record schema has a Drop On Input property that you can use to specify that that particular column does not get read into the job.

This is only true in the parallel job Sequential File stage.
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