William,

FYI. This what I use to create directory and set up ownership in a batch job. 
Some companies may need to change the pipe char from '!' to '|'. 

-----------------------------------------------
//STEP1    EXEC PGM=BPXBATCH                               
//SYSPRINT DD  SYSOUT=*                                    
//STDOUT  DD  SYSOUT=*                                     
//STDERR  DD  SYSOUT=*                                     
//STDPARM  DD   *                                          
SH                                                         
echo 'date' ! su ;                                         
echo 'mkdir -m 755 /home/y000001' ! su ;                   
echo 'mkdir -m 755 /home/y000001/.ssh2' ! su ;             
echo 'chown -R y000001:agroup  /home/y000001' ! su ;       
hostname;                                                  
ls -l /home;                                               
ls -la /home/y000001                                       
/*                                                         
-----------------------------------------------

Regards,
Ya-Fang


-----Original Message-----
From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of 
Boyer, William
Sent: Thursday, August 11, 2022 9:35 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: [EXTERNAL] Re: Superuser (su) in batch

Tried that.

OSHELL su
OPUT....
The OPUT failed on permissions.  


-----Original Message-----
From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of 
Ituriel do Neto
Sent: Thursday, August 11, 2022 9:25 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Superuser (su) in batch



 [External: Use caution with links & attachments]

You may try:

//STEP1  EXEC PGM=IKJEFT01 //SYSEXEC  DD   DISP=SHR,DSN=SYS1.SBPXEXEC 
//SYSTSPRT DD   SYSOUT=* //SYSTSIN  DD   *
  PROF MSGID WTPMSG
  OSHELL su                                                               



Best Regards

Ituriel do Nascimento Neto
z/OS System Programmer






Em quinta-feira, 11 de agosto de 2022 10:07:58 BRT, Rob Schramm 
<rob.schr...@gmail.com> escreveu: 





Coz toolkit is very easy to use for switching to superuser.

Rob

On Thu, Aug 11, 2022, 08:51 Boyer, William < 
00000442c7525a40-dmarc-requ...@listserv.ua.edu> wrote:

> 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.com<http://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

----------------------------------------------------------------------
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

----------------------------------------------------------------------
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