Reading input data from Sequential file
Moderators: chulett, rschirm, roy
Reading input data from Sequential file
I need to read an input sequential file(.csv) after first 5 records.How do I skip those first 5 rows while reading the file.
You have to read them, that's the nature of sequential media. You can skip them in the job using a constraint along the lines of:
Code: Select all
@INROWNUM > 5
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 301
- Joined: Thu Jul 14, 2005 10:27 am
- Location: Melbourne, Australia
- Contact:
... or you can skip them in Unix using the 'tail' command as a filter on your sequential file stage:
HTH,
J.
Code: Select all
tail +6
J.
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
Make sure you run in sequential mode for craigs solution. If thats not what you want then provide the following filter command to restrict the first 5 rows at the sequential file stage itself.
Code: Select all
sed '1,5d'
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If the first five rows don't match the metadata of the remaining rows, you can get away with doing nothing, just allow the import to fail for these rows (though it will log a warning message). You can capture these import failures via a Reject link on the Sequential File stage, thus allowing your to reconcile the row counts.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.