Page 1 of 1

Record Count

Posted: Thu Jun 24, 2010 11:16 pm
by kogads
Hi All,
I am extracting files for a directory using a file pattern using sequential file. I need to perform audit check as well for all the files. Each file has record count as a part of its name. Ex. test1.R3000. This test1 file has 3000 records. I need to abort the job if the record count fail. As iam extracting using file pattern how can I reject the file that does not pass the audit check and extract remaining files.

Thanks in advance

Posted: Fri Jun 25, 2010 2:15 am
by ray.wurlod
Lots of ways. Probably the easiest is a Routine activity to verify the row count in the file against the file name.

Posted: Fri Jun 25, 2010 3:00 am
by Sainath.Srinivasan
You can do a

Code: Select all

wc -l yourFilePattern
and compare the line counts

Posted: Fri Jun 25, 2010 6:07 am
by chulett
When does this 'abort' need to happen? Any check like that can be made well before it ever hits a DataStage job, if that's what you need. Or you could count it first, pass that count to the job and have it validate that count as part of its processing... usually involving an Aggregator doing the counting.