You can try to use STDPARM and piping the command to SU:

//STEP0001 EXEC PGM=BPXBATCH
//STDENV   DD *
_BPX_SHAREAS=YES
_BPX_BATCH_SPAWN=YES
//STDOUT   DD SYSOUT=*
//STDERR   DD SYSOUT=*
//STDPARM  DD *
SH echo "mkdir -p /some/dir &&&& chmod -R 750 /some/dir" | su

On Tue, Aug 25, 2026 at 1:13 PM Radoslaw Skorupka <
[email protected]> wrote:

> The following job step
>
> //K10 EXEC PGM=BPXBATCH,
> // PARM='SH mkdir -p /some/dir &&&& chmod -R 750 /some/dir'
>
> There are two commands in a step:
> a) mkdir
> b) chmod
>
> It works fine, however it require UID(0)  or other authorities in
> UNIXPRIV class.
> However the submitter has neither UID(0) nor the authorities in UNIXPRIV.
> But he has access to BPX.SUPERUSER, so he's allowed to enter TSO OMVS
> and issue "su" command (without parameters) to get effective UID(0) for
> subsequent commands.
>
> Question:
> is it possible to add "su" to the PARM field?
> How to code it?
>
> --
> Radoslaw Skorupka
> Lodz, Poland
>
> ----------------------------------------------------------------------
> 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

Reply via email to