You could use SDSF in batch to do it...or if you just want to find out if a certain job is running or not you could go diving down the control blocks in REXX to do it...or you could use the status command to do it.
/* rexx */
arg parm
tsom = outtrap(jobst.)
address tso "status "parm
tsom = outtrap('off')
actflg = 0
jj = 0
do i=1 to jobst.0
activ = index(jobst.i,'EXECUTING')
if activ <> 0 then do
jobn = word(jobst.i,3)
jobnl = pos('(',jobn)
jobn = substr(jobn,1,jobnl-1)
say jobn 'active'
jj = jj+1
job.jj = jobn
actflg = 1
end
end
Hope this helps