How to fail a sequence when count does not match

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
theone
Participant
Posts: 36
Joined: Tue Oct 06, 2009 10:04 am
Location: Michigan

How to fail a sequence when count does not match

Post by theone »

I am planning to implement a sequence failure if audit process does not match, where the record count using datastage does not match with the count in trailer or header of the file.

Any input in suggestions or previous post links are greatly appreciated.
BI-RMA
Premium Member
Premium Member
Posts: 463
Joined: Sun Nov 01, 2009 3:55 pm
Location: Hamburg

Post by BI-RMA »

One option is to perform a lookup on the row-count using the value from the trailer as reference. Leave the lookup in default-mode (fail) for lookup-failures. This will cause your job to abort when the number of rows in the file differs from the value given in the trailer.

Another option is to export both your count and that from the trailer to a sequential file, read the content of that file using a command-stage in the sequence and evaluate the result to control the flow of your sequence (use specific custom-triggers).

There are likely to be other solutions. Depends on what you prefer...
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
Post Reply