Created
November 30, 2026 21:06
-
-
Save mainframed/5cac8f6fa32d611b80deae3c2d406791 to your computer and use it in GitHub Desktop.
print every spool DD (incl. input JCL) for all jobs whose name starts with a prefix (default: your user ID)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* rexx - print every spool DD (incl. input JCL) for all jobs */ | |
| /* whose name starts with a prefix (default: your user ID) */ | |
| /* */ | |
| /* usage: jobdds [prefix] e.g. jobdds (MYID*) */ | |
| /* jobdds PAYRL (PAYRL*) */ | |
| parse upper arg prefix . | |
| if prefix = '' then prefix = userid() | |
| prefix = strip(prefix, 'T', '*') | |
| rc = isfcalls('ON') | |
| isfprefix = prefix'*' | |
| isfowner = '*' | |
| isfinput = 'ON' /* show input data sets like JESJCLIN */ | |
| address SDSF "ISFEXEC ST" | |
| if rc <> 0 then call bail 'ISFEXEC ST' | |
| if jname.0 = 0 then do | |
| say 'No jobs found matching' prefix'*' | |
| rc = isfcalls('OFF') | |
| exit 4 | |
| end | |
| /* summary first */ | |
| say 'Jobs matching' prefix'*:' jname.0 | |
| do i = 1 to jname.0 | |
| say ' ' left(jname.i, 8) left(jobid.i, 9) left(queue.i, 10) retcode.i | |
| end | |
| say '' | |
| /* now every DD of every job */ | |
| do i = 1 to jname.0 | |
| say copies('#', 70) | |
| say '# JOB' jname.i jobid.i ' queue='queue.i ' rc='retcode.i | |
| say copies('#', 70) | |
| address SDSF "ISFACT ST TOKEN('"token.i"') PARM(NP ?)", | |
| "(PREFIX dd_" | |
| if rc <> 0 then do | |
| say ' ** could not list data sets, rc='rc | |
| call showmsgs | |
| iterate | |
| end | |
| do j = 1 to dd_ddname.0 | |
| say copies('=',20) jname.i jobid.i dd_stepn.j dd_procs.j, | |
| dd_ddname.j copies('=',20) | |
| address SDSF "ISFBROWSE ST TOKEN('"dd_token.j"')" | |
| if rc <> 0 then do | |
| say ' ** could not browse' dd_ddname.j', rc='rc | |
| call showmsgs | |
| iterate | |
| end | |
| do k = 1 to isfline.0 | |
| say isfline.k | |
| end | |
| end | |
| say '' | |
| end | |
| rc = isfcalls('OFF') | |
| exit 0 | |
| showmsgs: | |
| if symbol('isfmsg2.0') = 'VAR' then | |
| do m = 1 to isfmsg2.0; say ' ' isfmsg2.m; end | |
| return | |
| bail: | |
| say arg(1) 'failed, rc='rc | |
| call showmsgs | |
| rc = isfcalls('OFF') | |
| exit 8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment