More MVS3.8J control blocks – Job Step control blocks

Well this was a real pain to work out. There are lots of hits on google on how to find the completion code of prior steps in later mvs releases using the SWAREQ macro… but that macro does not exist in mvs3.8J.

But I had a need to have a program to run as a jobstep that could find the completion status of every prior jobstep in the current batch job (yes, playing with job dependency scheduling again, trying to get rid of all the jcl cond= checks, if I can replace five or six jcl jobsteps with a single step that will run cond=even (even if the batch job shat itself badly) with a program that can determine all the prior step completion codes or if prior steps abended then it would be so much cleaner)… so I kept looking.

I was using a PROC at the end of every scheduled job that relied on JCL cond= codes to pass a parm to my scheduling program to determine what action it should take; tests like < maxcc, did anything abend, and even a seperate step to run if all was ok. Really messy, muliple job steps in the PROC of which only one would ever run depending on the condition code test. Anyway, to cut a long story short google (after a few months of trying various +/- search terms) found an example of an old JES2 exit that broke all the rules by using OS control blocks to populate JES2 fields instead of using JES2 structures. Yippee. As I need this I have saved an example program in my github repository in the mvs38j section as getmaxcc.

A copy is also available locally but the local copy is my ‘I wonder what happens if I do X’ copy so use the local copy at your own risk.

But the good news is it is possible for a mvs38j program in a batch job step to determine what happened in prior job steps… assuming you would ever need such a thing.
Well I did need such a thing, and as there are no VS/2 data areas manuals available in the wild hopefully having a coding example on github will help others searching for the same functionality.

About mark

At work, been working on Tandems for around 30yrs (programming + sysadmin), plus AIX and Solaris sysadmin also thrown in during the last 20yrs; also about 5yrs on MVS (mainly operations and automation but also smp/e work). At home I have been using linux for decades. Programming background is commercially in TAL/COBOL/SCOBOL/C(Tandem); 370 assembler(MVS); C, perl and shell scripting in *nix; and Microsoft Macro Assembler(windows).
This entry was posted in MVS3.8J. Bookmark the permalink.