Reading Valid records from 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
sjordery
Premium Member
Premium Member
Posts: 202
Joined: Thu Jun 08, 2006 5:58 am

Reading Valid records from sequential file

Post by sjordery »

Hi All,

I am just trying to read a sequential file having 1 column.
When I count the no of lines in the file it shows 100 lines but 20 records having proper values rest are only blank lines i.e 80 times enter key has been pressed while writing.
To avoid those records i specfiled the column as not null but still i am not able to avoid those unwanted 80 records.I also tried by specifying final delimeter string as '\n' but no luck.

Could any one suggest how to do this?
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Constraint it in the transformer stage by specifying LEN(In.Col) > 0 or something.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
throbinson
Charter Member
Charter Member
Posts: 299
Joined: Wed Nov 13, 2002 5:38 pm
Location: USA

Post by throbinson »

How about nipping it in the bud by filtering out the unwanted rows in the Sequential stage?

Code: Select all

grep -v ^$
should filter out empty lines
Post Reply