Here we go. I'll note that I've modified it to use BPXWDYN to
allocate/deallocate the output file.
//OPERCMD EXEC PGM=IKJEFT1B,PARM='%OPERCMDB'
//SYSEXEC DD DSN=your.sysexec.dsn,DISP=SHR
//SYSIN DD *
D T
D PROG,APF
D PROG,LNKLST
/*
//SYSTSIN DD DUMMY
//SYSTSPRT DD DUMMY
000001 /* REXX */
000002 /* this REXX exec will issue operator commands via SDSF REXX interface
000003 security is based on the person using the command. this exec is to
be
000004 used for batch only */
000005 'EXECIO * DISKR SYSIN (STEM mycmd. FINIS'
000006 if rc > 0 then do
000007 say 'Return code from OPEN was' rc
000008 say 'Aborting...'
000009 exit
000010 end
000011
000012 /* Allocate results output file */
000013 Call BPXWDYN "alloc rtddn(ddnm) sysout"
000014
000015 /* Process all input commands */
000016 Do c=1 to mycmd.0
000017 oper_command.0 = 1
000018 oper_command.1 = mycmd.c
000019 Call Main_process
000020 End
000021
000022 /* Free results output file */
000023 Call BPXWDYN "free fi(ddnm)"
000024 Return 0
000025
000026 Main_process:
000027 /* process all data from SYSIN */
000028 rc=isfcalls('ON')
000029 Address SDSF ISFSLASH "("oper_command.") (WAIT)"
000030 l_cnt = 0
000031 If datatype(isfulog.0) = "NUM" Then Do
000032 If isfulog.0 <> 0 Then Do
000033 l_cnt = l_cnt + 1
000034 l.l_cnt = substr(isfulog.1,1,43)
000035 Do ix=1 to isfulog.0
000036 ll = length(isfulog.ix)
000037 if ll <> 0 Then
000038 qdata = substr(isfulog.ix,44,ll-43)
000039 else
000040 qdata = isfulog.ix
000041 l_cnt = l_cnt + 1
000042 l.l_cnt = qdata
000043 End
000044 End
000045 Else Do
000046 l_cnt = l_cnt + 1
000047 l.l_cnt = "No command response available"
000048 End
000049 End
000050 Else Do
000051 l_cnt = l_cnt + 1
000052 l.l_cnt = "Error in command reponse"
000053 End
000054 rc=isfcalls("OFF")
000055 If (l_cnt = 0) Then Do
000056 l_cnt = l_cnt + 1
000057 l.l_cnt = ' /* no data produced */'
000058 End
000059 l.0 = l_cnt
000060 Address MVS "ExecIO "l_cnt" DiskW "ddnm" (Finis Stem l.)"
000061 l_cnt = 0
000062 Return
_________________________________________________________________
Dave Jousma
Manager Mainframe Engineering, Assistant Vice President
[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 Barkow, Eileen
Sent: Friday, April 28, 2017 2:28 PM
To: [email protected]
Subject: Re: VARY command in a batch job
Thanks for the explanation about the security.
Can I get a copy of the OPERCMDB clist?
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf
Of Jousma, David
Sent: Friday, April 28, 2017 2:23 PM
To: [email protected]
Subject: Re: VARY command in a batch job
Not OPERATIONS authority specifically. But the ISFSLASH service uses the same
SAF calls that would be used if you were literally in SDSF entering a /V
XCF,sysname,OFFLINE. So if you have access to MVSCMDS, OPERCMDs, etc then you
will have access. What you don’t need is TSO CONSOLE authority.
_________________________________________________________________
Dave Jousma
Manager Mainframe Engineering, Assistant Vice President [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 Barkow, Eileen
Sent: Friday, April 28, 2017 2:21 PM
To: [email protected]
Subject: Re: VARY command in a batch job
Don’t you need RACF OPERATIONS authority or its equivalent to issue the
commands?
Can you just give other people authority to issue commands without having it
yourself?
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf
Of Jousma, David
Sent: Friday, April 28, 2017 2:15 PM
To: [email protected]
Subject: Re: VARY command in a batch job
Yep. That was me! I can provide it again if anyone wants it.
_________________________________________________________________
Dave Jousma
Manager Mainframe Engineering, Assistant Vice President [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 Cieri, Anthony
Sent: Friday, April 28, 2017 1:34 PM
To: [email protected]
Subject: Re: VARY command in a batch job
There was a similar discussion on the List back in January of this year, where
someone provided a nice Rexx exec that issued operator commands via the SDSF
Rexx API. The Rexx was called OPERCMDB and was executed via JCL. This would
allow you to "authorize" only those who need it, instead of opening up command
submission for everyone!!!!
Hth
Tony
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf
Of Steve Beaver
Sent: Friday, April 28, 2017 11:28 AM
To: [email protected]
Subject: Re: VARY command in a batch job
Just remember, you need to BLOCK who can send COMMANDS through the // COMMAND
or you have opened yourself up
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf
Of Jousma, David
Sent: Friday, April 28, 2017 10:26 AM
To: [email protected]
Subject: Re: VARY command in a batch job
>If you submit your test with TYPRUN=HOLD, does the command get executed?
Yes. As soon as it gets interpreted. As for a "command issuer", I stole a
rexx exec from IBM that uses ISFSLASH to issue commands, and trap the
responses. Uses your standard SAF interfaces to authorize command use, etc.
I don’t know why IBM just hasn’t packaged something standard for use.
_________________________________________________________________
Dave Jousma
Manager Mainframe Engineering, Assistant Vice President [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 Tom Marchant
Sent: Friday, April 28, 2017 10:36 AM
To: [email protected]
Subject: Re: VARY command in a batch job
On Fri, 28 Apr 2017 14:18:37 +0000, william janulin wrote:
>Guys,I just did a quick test of a batch job with a // COMMAND statement
>in it , using IEFBR14, it worked fine.
>Thank you everyone for your responses, Bill J.
When did it work? IIRC the command is issued when it is read or converted.
If you want the command to be issued at a time relative to other steps in the
job, you'll need a program to submit the command. If you submit your test with
TYPRUN=HOLD, does the command get executed?
--
Tom Marchant
----------------------------------------------------------------------
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
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to
[email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
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
________________________________
This e-mail, including any attachments, may be confidential, privileged or
otherwise legally protected. It is intended only for the addressee. If you
received this e-mail in error or from someone who was not authorized to send it
to you, do not disseminate, copy or otherwise use this e-mail or its
attachments. Please notify the sender immediately by reply e-mail and delete
the e-mail from your system.
----------------------------------------------------------------------
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
----------------------------------------------------------------------
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