Here is a working example.  Technically, BPXBATCH only allows for 1 command.  
So you need to write a script, or stack multiple commands as one with the 
semicolon.

//OMVS     EXEC PGM=BPXBATCH
//*****************************************
//*  unmount the specified share.
//*****************************************
//STDERR   DD   DSN=&&STDERR,DISP=(NEW,PASS),RECFM=FBA,LRECL=133,
// BLKSIZE=0,SPACE=(CYL,(5,1))
//STDOUT   DD   DSN=&&STDOUT,DISP=(NEW,PASS),RECFM=FBA,LRECL=133,
// BLKSIZE=0,SPACE=(CYL,(5,1))
//STDPARM  DD   *
SH cd /remote;
echo 'unmount mobius' | su;
echo 'unmount mobiusE' | su;
echo 'unmount chkstkT' | su;
echo 'unmount chkstk' | su;
ls -al
/*




​​​​​​​​​​​​​​​​​​​​​​​​​​​​_______________________________

Dave Jousma

Vice President | Director, Technology Engineering

Fifth Third Bank | 1830 East Paris Ave, SE | Grand Rapids, MI 49546






From: IBM Mainframe Discussion List <[email protected]> on behalf of 
Farley, Peter <[email protected]>
Date: Wednesday, October 8, 2025 at 11:32 AM
To: [email protected] <[email protected]>
Subject: Re: BPXBATCH question

CAUTION EXTERNAL EMAIL
This message came from outside your organization.
DO NOT open attachments or click on links from unknown senders or unexpected 
emails.
Report 
Suspicious<https://us-phishalarm-ewt.proofpoint.com/EWT/v1/MwwqYLOC6b6whF7V!odOFNz8FgiAhvko5LDivV__DuuLEDdE0Rf5JAPLS1h-Y3pzQivtuJWPTTPyLYzwxAR6ze8_C9xCAyCI9XnbhBWknaSFiZEhzRjUcFwTJZhyfw5Wz6ZFTvWPE5NNuNk2LJpI0b6YgyFCLGQ$>


No help unfortunately.  I tried both of these (AOPBATCH requires the leading 
“/” in the PARM):


//SHOWSHEL EXEC PGM=AOPBATCH,PARM='//bin/echo $PATH'

//STDIN       DD  DUMMY

//STDOUT   DD  SYSOUT=*

//STDERR   DD  SYSOUT=*


//SHOWSHEL EXEC PGM=AOPBATCH,PARM='//bin/sh -c /bin/echo $PATH'

//STDIN       DD  DUMMY

//STDOUT   DD  SYSOUT=*

//STDERR   DD  SYSOUT=*

RC=0, STDOUT had zero lines of output.

Peter

From: IBM Mainframe Discussion List <[email protected]> On Behalf Of 
rpinion865
Sent: Wednesday, October 8, 2025 11:23 AM
To: [email protected]
Subject: Re: BPXBATCH question

Maybe you could try AOPBATCH. "Confidentially doc, I am the wabbit. " Bugs 
Bunny Sent with Proton Mail secure email. On Wednesday, October 8th, 2025 at 
11: 11 AM, Farley, Peter <0000031df298a9da-dmarc-request@ LISTSERV. UA. EDU> 
wrote: >


Maybe you could try AOPBATCH.







"Confidentially doc, I am the wabbit."



Bugs Bunny



Sent with Proton Mail secure email.



On Wednesday, October 8th, 2025 at 11:11 AM, Farley, Peter 
<[email protected]> wrote:



> I have a simple execution of BPXBATCH where all I wish to accomplish is to 
> display the PATH in effect when BPXBATCH starts a shell instance and the 
> environment variables that are set. Here is my simple JCL setup:

>

> //SHOWSHEL EXEC PGM=BPXBATCH,PARM=SH

> //STDIN DD *

> /bin/echo $PATH

> /bin/env

> //STDOUT DD SYSOUT=*

> //STDERR DD SYSOUT=*

>

> The output on STDOUT reflects the messages generated by /etc/profile but 
> nothing else.

>

> According to "Chapter 19. BPXBATCH utility" in the "XL C/C++ Users Guide", 
> "If you specify SH with no program-name information, BPXBATCH attempts to run 
> anything read in from stdin.".

>

> That is not happening, and I do not understand why not.

>

> Any RTFM or other information you can provide to cure my ignorance is 
> appreciated.

>

> Unfortunately we do not have the luxury of having the CoZ tools installed 
> here so I do not have COZBATCH as an alternative.

>

> Peter

>

> This message and any attachments are intended only for the use of the 
> addressee and may contain information that is privileged and confidential. If 
> the reader of the message is not the intended recipient or an authorized 
> representative of the intended recipient, you are hereby notified that any 
> dissemination of this communication is strictly prohibited. If you have 
> received this communication in error, please notify us immediately by e-mail 
> and delete the message and any attachments from your system.

>

> ----------------------------------------------------------------------

> 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 message and any attachments are intended only for the use of the addressee 
and may contain information that is privileged and confidential. If the reader 
of the message is not the intended recipient or an authorized representative of 
the intended recipient, you are hereby notified that any dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately by e-mail and delete the message and any 
attachments 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

Reply via email to