The other question I have all the time is, what has the poster already tried? Also, when is it going to sink in that REXX has nothing to do with any of this. Using the standard TSO commands for job processing: SUBMIT, STATUS, and OUTPUT, has met my needs on occasion for many, many years. When they're not sufficient, then I've turned to using batch and/or programming interfaces to whatever spool/output management tool I had to work with: IOF, Sysview, or more recently, SDSF.
It's what, about 20 or so lines of code:
/* REXX */
Queue "//JOBNAME# JOB (...),'...',"
Queue ...
Queue "$$"
Call Outtrap(j.)
"SUBMIT * END($$)"
Call Outtrap(Off)
/* IKJ56250I JOB JOBNAME#(JOB#####) SUBMITTED */
Parse Var j.2 . "JOB " joblist " SUBMITTED" .
Do Forever
Call Outtrap(j.)
"STATUS "joblist
Call Outtrap(Off)
/* IKJ56197I JOB JOBNAME#(JOB#####) WAITING FOR EXECUTION */
/* IKJ56211I JOB JOBNAME#(JOB#####) EXECUTING */
/* IKJ56192I JOB JOBNAME#(JOB#####) ON OUTPUT QUEUE */
Parse Var j.1 . "JOB " joblist status
If status = "ON OUTPUT QUEUE" Then Leave
End
Parse Var joblist jobname "(" jobid ")" .
outdsn = "OUTPUT."jobname".#'jobid
"OUTPUT "joblist" PRINT("outdsn")"
Exit 0