I blogged on a related topic here <https://colinpaice.blog/2021/12/06/how-difficult-can-it-be-to-use-bpxbatch-it-is-harder-and-more-interesting-than-you-may-think/> and my solution was to use JCL symbols. It may work with stdenv.
// EXPORT SYMLIST=* *// SET SAA='longstring1'// SET SBB='long string 2'* //IHS EXEC PGM=BPXBATCH,REGION=0M,PARMDD=PARMDD //PARMDD DD * SYMBOLS=JCLONLY SH longname.sh xx *-aa &SAA -bb &SBB* -debug longstring /* /* On Thu, 24 Feb 2022 at 14:43, Mario Bezzi < subscriptions.mario.be...@gmail.com> wrote: > 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 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