Posted: Fri Feb 16, 2007 9:12 am Post subject: how to stop job exececution, if file has less than 100 recs
Hi Guys,
I have a requirement to stop executing a job when the number of records in a file is less than 100. Job should end with Return code zero. Please assist.
1) Input file is a VSAM KSDS file - key first 4 bytes.
2) Job has more that 20 steps
3) Record count has to be checked in the first step.
If writing a Cobol program an option for you, then write a program that counts the number of records in the input file. If they are less than 100, move '1' (or some other number to RETURN-CODE). In the JCL, use condition codes to skip/ continue the rest of the steps based on the condition code. Remember to change the return code to zero in the jcl in case you decide to skip the rest of the steps.
________
buy easy vape
Last edited by blitz2 on Wed Feb 02, 2011 3:11 am; edited 1 time in total
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
Posted: Mon Feb 19, 2007 4:25 am Post subject:
are you saying that EVERY step in the job MUST return a code of 0 or are you saying that the job must not abend? If the first then you cannot. I f the latter then the first response is as good as any - I've just done it for myself except I'm indicating an empty file and doing alternative processing. _________________ Utility and Program control cards are NOT, repeat NOT, JCL.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Mon Feb 19, 2007 10:03 am Post subject:
Split the job into 2 jobs. Job1 will have just the 2 steps. In the first step it will check the record count and step2 it will submit the job 2(with all the other steps) or do nothing
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum