Try this code....of course the usual disclaimers apply
/* rexx */
arg parm
pee =''
signal on novalue /* un-initialized vars*/
signal on halt /* attention key */ address "TSO" dat='' actn='' help='N' do until(parm='')
parse var parm next parm
select
when next = "?" | abbrev("HELP",next,1) then do
call disp_help
exit (4)
end
when abbrev("DEBUG",next,1)then,
trace("R")
when next = "" then do
say "Enter ASID name"
parse upper pull next
end
end x = length(next)
numeric digits 10
cvt_ptr=get_ptr(10,)
cvtn = c2d(storage(10,4)) /* address of cvt */ basea_ptr=get_ptr(cvt_ptr,'94') /* address of basea */ chn_ptr=get_ptr(basea_ptr,'0') /* address of cscb */ run = 'n'
do until (next_entry = 0)
next_chn=get_ptr(chn_ptr,'0') /* address of next cscb */
taskname = get_data(chn_ptr,'8',8)
lst_ptr=get_data(basea_ptr,'0',4)
next_entry = d2x(x2d(chn_ptr) + 0)
taskname2 = substr(taskname,1,x)
if taskname2=next then do
say taskname "is running"
end
chn_ptr = next_chn end if run = 'y' then do
exit (0)end else do
say "No tasks for" next "are running"
exit (8)
end end exit (0)
get_ptr: procedure
arg addr,offset
temp=d2x(x2d(addr)+x2d(offset))
return c2x(storage(temp,4))exit get_data: procedure
arg addr,offset,length
temp=d2x(x2d(addr)+x2d(offset))
return storage(temp,length)exit disp_help: procedure
pgm_name=sysvar("sysicmd")
if pgm_name="" then pgm_name="name"
say left(pgm_name,8) "- a REXX exec to check to see if a" say " passed address space name is active" say "" say "Usage: ACTIVE | debug | help | ? | asid" say ""
say " debug - turns on REXX tracing."
say " help - generates this information."
say " ? - generates this information."
say " asid - the Address space name to be checked" say "" return /* trap NOVALUE condition */ novalue: say "NOVALUE entered from line" sigl
say condition("D")
say "The instruction is suppressed"
address "TSO" "delstack" exit(16)
/* trap HALT condition */ halt: say "HALT acknowledged in line" sigl
say "Cleanup processing in progress"
address "TSO" "delstack" exit(16)