Record Count

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
kogads
Premium Member
Premium Member
Posts: 74
Joined: Fri Jun 05, 2009 5:36 pm

Record Count

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

You can do a

Code: Select all

wc -l yourFilePattern
and compare the line counts
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply