Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help needed reg checking job status

Status
Not open for further replies.

maxneo02

Programmer
Oct 22, 2003
6
0
0
IN
Hi All,

Is there a way to throw a message to user saying that jobs his jobs are still running when he is trying to logoff. And is it possible to purge jobs after receiving confirmation from user for doing the same.
 
It should be possible (on z/OS aka MVS) to write a little REXX to do the notify part....but I have to ask....Why bother? As for purging jobs that would have to be done via a JES2 command and that would involve some security considerations to ensure that the user was authorised to issue JES2 commands and to make sure that they only issue purges against their own jobs. Do you have SDSF?
 
Thanks Kevin. I want to ensure that users dont leave jobs running that might get into infinite loop brining down the system. Because this has happened in the past. Is there a way that we can find out jobs running under his/her ID and notify him when he/she is trying to logoff? can you please give me pointers on how to proceed on this.
 
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)
 
Whoops...let me try this again

/* 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
display ='y'
end
otherwise
display ='n'
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)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top