Here is what I am trying to accomplish:
If say Job Step 10 gets a return code of 12, I have Job step 20 that only runs if JS010 RC > 8. However, JS020 executes a program that will insert a row to a Database and I want to capture the Return code value from JS010 and pass it to the program as a parm?
Joined: 26 Apr 2004 Posts: 4650 Location: Raleigh, NC, USA
1. Easiest. Don't do this.
2. Easier. Have the program in JS010, as it performs the "MOVE 12 TO RETURN-CODE" before it ends also write this information to an output dataset, which can then be read and used by the program in JS020.
3. Harder. Have the job end after JS010. Use a tool to read the job statistics from the JES spool (i.e. SDSF, IOF, Sysview), or run a query against your job scheduler, and retrieve step JS010's return-code value. Store that value, and pass in to another job that will start with the program that is currently your JS020 step.
4. Hardest. Code a program that reads the MVS Control Block information from JS010, find the offset where the value for the RETURN-CODE register for JS010 is located, write that value to a dataset, and then have the program in JS020, again, read that dataset.