I recently discovered the ISFSLASH facility of SDSF, assuming you are a SDSF
customer. Doesn't require TSO CONSOLE authority. Here's a REXX that I
stole/updated to run in batch, and writes the responses from the command to
output.
/* REXX */
/* this REXX exec will issue operator commands via SDSF REXX interface
security is based on the person using the command. this exec is to be
used for batch only */
'EXECIO * DISKR SYSIN (STEM mycmd. FINIS'
if rc > 0 then do
say 'Return code from OPEN was' rc
say 'Aborting...'
exit
end
/* Allocate results output file */
ddnm = 'DD'||random(1,99999)
Address TSO "Alloc Fi("ddnm") SYSOUT"
/* Process all input commands */
Do c=1 to mycmd.0
oper_command.0 = 1
oper_command.1 = mycmd.c
Call Main_process
End
/* Free results output file */
Address TSO "Free Fi("ddnm")"
Return 0
Main_process:
/* process all data from SYSIN */
rc=isfcalls('ON')
Address SDSF ISFSLASH "("oper_command.") (WAIT)"
l_cnt = 0
If datatype(isfulog.0) = "NUM" Then Do
If isfulog.0 <> 0 Then Do
l_cnt = l_cnt + 1
l.l_cnt = substr(isfulog.1,1,43)
Do ix=1 to isfulog.0
ll = length(isfulog.ix)
qdata = substr(isfulog.ix,44,ll-43)
l_cnt = l_cnt + 1
l.l_cnt = qdata
End
End
Else Do
l_cnt = l_cnt + 1
l.l_cnt = "No command response available"
End
End
Else Do
l_cnt = l_cnt + 1
l.l_cnt = "Error in command reponse"
End
rc=isfcalls("OFF")
If (l_cnt = 0) Then Do
l_cnt = l_cnt + 1
l.l_cnt = ' /* no data produced */'
End
l.0 = l_cnt
Address MVS "ExecIO "l_cnt" DiskW "ddnm" (Finis Stem l.)"
l_cnt = 0
Return
_________________________________________________________________
Dave Jousma
Assistant Vice President, Mainframe Engineering
[email protected]
1830 East Paris, Grand Rapids, MI 49546 MD RSCB2H
p 616.653.8429
f 616.653.2717
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf
Of Jon Perryman
Sent: Wednesday, June 25, 2014 1:27 PM
To: [email protected]
Subject: Re: setprog command RACF issue
If you run REXX in a TSO batch,step, then you can use the TSO CONSOLE interface
to issue commands and process the response.
Jon Perryman.
On Wednesday, June 25, 2014 8:55 AM, zMan <[email protected]> wrote:
We have various test environments that need a series of operator
>commands, and if I could put them into a job (or a Rexx program--is it
>also possible to issue them from Rexx?), it would make life easier.
>
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to
[email protected] with the message: INFO IBM-MAIN
This e-mail transmission contains information that is confidential and may be
privileged. It is intended only for the addressee(s) named above. If you
receive this e-mail in error, please do not read, copy or disseminate it in any
manner. If you are not the intended recipient, any disclosure, copying,
distribution or use of the contents of this information is prohibited. Please
reply to the message immediately by informing the sender that the message was
misdirected. After replying, please erase it from your computer system. Your
assistance in correcting this error is appreciated.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN