I didn't see any mention of AOPBATCH.  I tried it, and it appears to work.

//STEP020 EXEC PGM=AOPBATCH,PARM='sh'
//STDIN   DD *
 su
 ls -al
//STDERR  DD SYSOUT=*
//STDOUT  DD SYSOUT=*




Sent with Proton Mail secure email.

------- Original Message -------
On Friday, August 12th, 2022 at 7:30 AM, Robert S. Hansel (RSH) 
<r.han...@rshconsulting.com> wrote:


> Hi William,
>
> Here are examples of several different ways I found for doing this.
>
> //RSHBPXSU JOB (1),RSH,CLASS=A,MSGCLASS=H,NOTIFY=&SYSUID
> //STEP0010 EXEC PGM=BPXBATCH,PARM='SH'
> //STDERR DD SYSOUT=*
> //STDOUT DD SYSOUT=*
> //STDIN DD PATH='/u/RSH/commands',PATHOPTS=(ORDONLY) << su in stdin file
>
> //RSHBPXSU JOB (1),RSH,CLASS=A,MSGCLASS=H,NOTIFY=&SYSUID
> //STEP0010 EXEC PGM=BPXBATCH,PARM='SH su'
> //STDERR DD SYSOUT=*
> //STDOUT DD SYSOUT=*
> //STDIN DD PATH='/u/RSH/commands2',PATHOPTS=(ORDONLY)
>
> //RSHBPXSU JOB (1),RSH,CLASS=A,MSGCLASS=H,NOTIFY=&SYSUID
> //STEP0010 EXEC PGM=BPXBATCH,PARM='SH su < /u/RSH/commands2'
> //STDERR DD SYSOUT=*
> //STDOUT DD SYSOUT=*
>
> //RSHBPXSU JOB (1),RSH,CLASS=A,MSGCLASS=H,NOTIFY=&SYSUID
> //STEP0010 EXEC PGM=BPXBATCH
> //STDERR DD SYSOUT=*
> //STDOUT DD SYSOUT=*
> //STDPARM DD *
> SH su < /u/RSH/commands3
>
> //RSHSUTST JOB (1),RSH,CLASS=A,MSGCLASS=H,NOTIFY=&SYSUID
> //STEP0001 EXEC PGM=IKJEFT1B
> //SYSPROC DD DISP=SHR,DSN=SYS1.SBPXEXEC
> //SYSOUT DD SYSOUT=*
> //SYSIN DD DUMMY
> //SYSTSPRT DD SYSOUT=*
> //SYSTSIN DD *
> PROF MSGID WTPMSG
> OSHELL echo id | su
> OSHELL print 'id' | su
>
> Regards, Bob
>
> Robert S. Hansel
> Lead RACF Specialist
> RSH Consulting, Inc. *** Celebrating our 30th Anniversary ***
> 617-969-8211
> www.linkedin.com/in/roberthansel
> www.twitter.com/RSH_RACF
> www.rshconsulting.com
>
> -----Original Message-----
> Date: Thu, 11 Aug 2022 12:50:49 +0000
> From: "Boyer, William" william.bo...@gdit.com
>
> Subject: Superuser (su) in batch
>
> My userid on z/OS is not a superuser but I have RACF READ access to 
> BPX.SUPERUSER. Occasionally as a Systems Programmer, I need to have perform 
> something in USS that requires UID=0. In TSO I can switch to EUID=0 by going 
> to 3.17 (Utilities/Udlist) and type a su which seems to stay set for the 
> entire length of the TSO session. Is there a way do a su in batch and then 
> copy files or adjust permits/owner etc.
>
> For example interactively, I can set my euid=0 with su in 3.17, then go to =6 
> and type in OPUT to copy files into USS to directories that my normal uid 
> does not have permission but the OPUT works because I am still euid=0. I am 
> looking for a way to do this in batch.
>
> Thanks
>
> William Boyer
> System Engineer Sr Advisor
>
> T 410-842-1706
> william.bo...@gdit.com
> One W. Pennsylvania Ave
> Towson, MD 21204
> www.gdit.comhttp://www.gdit.com/
>
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to