Would AOPBATCH help?

//STEP010 EXEC PGM=AOPBATCH,PARM='sh'           
//STDIN   DD *                                  
 "cp \"//'sys1.maclib(splevel)'\" /dev/fd/1" |  
        gzip >foosplevel.gz                     
//STDERR  DD SYSOUT=*                           
//STDOUT  DD SYSOUT=*                           

-----Original Message-----
From: IBM Mainframe Discussion List <[email protected]> On Behalf Of 
Mario Bezzi
Sent: Thursday, February 24, 2022 9:44 AM
To: [email protected]
Subject: BPXBATCH Environment Variable concatenation - STDENV

[External Email. Exercise caution when clicking links or opening attachments.]

Hello list,

I can't find an elegant way to pass a variable containing a long string to a 
USS shell command executed under BPXBATCH.

Looking at what the JVMLDMxx module (JVM invocation) does I tried something 
like the following:

//RUNTEST  EXEC PGM=BPXBATCH
//STDOUT   DD   SYSOUT=*
//STDERR   DD   SYSOUT=*
//STDENV   DD   *
IJO="-Xms16m -Xmx128m"
IJO="$IJO -verbose:class"
IJO="$IJO -Dfile.encoding=ISO8859-1"
//STDPARM  DD *
SH  echo $IJO

But the echo command returns the following:

"$IJO -Dfile.encoding=ISO8859-1"

Which shows that variable concatenation doesn't work as I would expect.

Manually executing the same commands under OMVS z/OS shell, everything works 
fine:

IBMUSER:/u/ibmuser: >IJO="-Xms16m -Xmx128m"
IBMUSER:/u/ibmuser: >IJO="$IJO -verbose:class"
IBMUSER:/u/ibmuser: >IJO="$IJO -Dfile.encoding=ISO8859-1"
IBMUSER:/u/ibmuser: >echo $IJO
-Xms16m -Xmx128m -verbose:class -Dfile.encoding=ISO8859-1

I know I may use a real file, or even a USS file to write a single assignment 
in one line, but I would like to avoid carrying unneeded baggage.

What I am doing wrong?

Thank you,
mario

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
[email protected] with the message: INFO IBM-MAIN
Confidentiality notice: 
This e-mail message, including any attachments, may contain legally privileged 
and/or confidential information. If you are not the intended recipient(s), or 
the employee or agent responsible for delivery of this message to the intended 
recipient(s), you are hereby notified that any dissemination, distribution, or 
copying of this e-mail message is strictly prohibited. If you have received 
this message in error, please immediately notify the sender and delete this 
e-mail message from your computer.


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to