Page 1 of 1

Threshold for Reject Records

Posted: Fri Dec 24, 2010 12:06 am
by praburaj
Hi,

My source file is having more than 10 lakhs records. When I execute my jobs some of the records are going to reject files. Now, my requirement Is If reject records are greater than 10% then I have to stop the job. I don't know how to achieve this?.

Please give me valuable Input for this

Posted: Fri Dec 24, 2010 12:38 am
by Sreedhar
Hi,

If you are loading into a database then we can stop. But if your requirement is to abort the job while read from Sequential file, where the reject are more then 10%, then you have to do that before the job starts.

You can call that as a Preprocessing.

Posted: Fri Dec 24, 2010 9:19 am
by chulett
Meaning, you'll need to get the count of records in the file before the job runs and pass that count in as a parameter so you can compute what 10% of that is at runtime... that or pass in the 10% threshold and use it directly.

Posted: Sat Dec 25, 2010 8:52 am
by praburaj
yes!I need to do like that. Plz help me how to do this?

Posted: Sat Dec 25, 2010 10:31 am
by chulett
A Sequence job could use an Execute Command stage to count the number of lines in the file using wc -l and the result could then be passed as a job parameter to your processing job. It might take a little tweaking - using Field() to separate the count from the filename in the output, if I recall correctly - but you can certainly make that approach work.