This WHOHAS IMOD processes an operator command.
Note: This IMOD is a sample only; it may not work in your environment.
#DESC Command: WHOHAS dsn
/*
This IMOD will notify the operator of current owners and waiters
for the data set. Add the next line to the CA‑GSS initialization
parameters and cycle the address space.
COMMAND VERB WHOHAS IMOD WHOHAS
*/
parse upper arg . dsn .
queue 'SRV000 WHOHAS'
queue 'DSNAME = '||dsn
handle = dsnenq('obtain')
if rc ^= 0 then do
say 'dsnenq.obtain returned '||rc||' ‑ '||handle
queue '*** Internal error 1 ***'
queue rc||' - '||handle
signal write2
end
result = dsnenq('info',handle,dsn)
if rc ^= 0 then do
if rc ^= 121 then do
say 'dsnenq.obtain returned '||rc||' - '||handle
queue '*** Internal error 2 ***'
queue rc||' - '||result
signal write
end
dsn_count = 0
end
if dsn_count < 1 then do
queue = '*** Data set not in use ***'
signal write
end
/* Tell operator who has data set */
queue 'Jobname System ASID Jobtype Ownership'
queue '-------- -------- ---- -------- --------------'
do i = 1 to dsn_count
queue dsn_jobname.i||' '|| ,
substr(dsn_sysid.i,1,8)||' '|| ,
d2x(dsn_asid.i,4)||' '|| ,
substr(dsn_jobtype.i,1,8)||' '|| ,
substr(dsn_status.i,1,4)||' '|| ,
substr(dsn_mode.i,1,4)
end
write:
result = dsnenq('release',handle)
write2:
result = mlwto(,,5,imod_console)
return
The IMOD execution process is as follows:
The following sample displays the current users of a data set and those users who are waiting for the data set:
17:45:40.22 WHOHAS KBROWNE.TEST.CAICLIB 17:45:40.88 STC05434 SRV000 WHOHAS 710 DSNAME = KBROWNE.TEST.CAICLIB JOBNAME SYSTEM ASID JOBTYPE OWNERSHIP -------- -------- ---- -------- -------------- KBROWNE MVSB1 00B8 TSU OWN SHR BATJOB MVSB1 00C8 JOB WAIT EXCL
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |