Page 1 of 1

Reading input data from Sequential file

Posted: Tue Apr 10, 2007 6:31 am
by mydsworld
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.

Posted: Tue Apr 10, 2007 6:43 am
by chulett
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

Posted: Tue Apr 10, 2007 7:43 am
by jhmckeever
... or you can skip them in Unix using the 'tail' command as a filter on your sequential file stage:

Code: Select all

 tail +6
HTH,
J.

Posted: Tue Apr 10, 2007 7:44 am
by DSguru2B
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'

Posted: Tue Apr 10, 2007 1:25 pm
by ray.wurlod
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.