How to take care of a Blank line at the end of a flat file

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
bapajju
Participant
Posts: 82
Joined: Wed Nov 19, 2003 11:58 pm

How to take care of a Blank line at the end of a flat file

Post by bapajju »

I have a job that reads from a CSV file. The problem is that this file has a blank line at the end of the file. Please let me know how to take care of this.

Thanks in advance
alhamilton
Participant
Posts: 12
Joined: Fri Apr 30, 2004 9:11 am

Post by alhamilton »

I would try to remove the line using shell commands before the DataStage job starts. If it truly is blank, then "grep "," should discard the line. Since it is a csv file all other lines would be output.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

You can include a constraint in the job. This is just in case you do not have this in the future.

Alternatively you can use OS commands to perform the same.
Post Reply