skip header records in a sequential file

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Aggie99
Participant
Posts: 54
Joined: Thu Sep 04, 2008 6:54 pm

skip header records in a sequential file

Post by Aggie99 »

hi guys,

I need your help on how to skip reading the first 10 rows of a sequential file.

I have a csv file, the first 10 records are metadata, the rest of the file is data records.

Metadata have different field format from non-metadata.

I try to read in the data, but not the metadata using sequential file stage. But I don't see an option that let me SKIP the first XX records so I can read from row 11 onward.

What can I do? thx for your help.
-Aggie
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

Can you run Unix commands on a Windows DS server? (we can on our clients so would expect similar functionality on the server)

An alternative is to define the input as one column (type varchar) per row and drop the first 10 rows through a transformer or filter stage
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Define the columns in the stage to match the data columns in the file, the records from 11 on. The stage will automatically discard the first 10 for not matching that.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Aggie99
Participant
Posts: 54
Joined: Thu Sep 04, 2008 6:54 pm

Post by Aggie99 »

that's what I am doing now, define the columns for records from row 11 onward. This resulted in a set of warnings in the log.
I guess I can downgrade the warnings. But I was hoping there're other options.

thx guys.

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

Post by ray.wurlod »

Put a reject link on the Sequential File stage. It will capture any row that does not match the metadata on the main output link.
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