IMHO it is easier to use the STDPARM DD along with SYMBOLS=JCLONLY to set up 
the BPXBATCH PARM

//    EXPORT SYMLIST=*
//    SET CPPOBJ='/u/userid/CertRept/Obj/'
...
//BPXARCH  EXEC PGM=BPXBATCH,COND=(4,LT)
//STDPARM  DD  *,SYMBOLS=JCLONLY
SH cd &CPPOBJ ; ls -la
//*

Just do not put any shell comment characters (#) in STDPARM (it is all treated 
as one continuous line which is why you need semicolons between each command).  
The first (#) you put in makes the rest of the STDPARM contents a comment.

Peter

From: IBM Mainframe Discussion List <[email protected]> On Behalf Of 
Charles Mills
Sent: Friday, October 24, 2025 1:46 PM
To: [email protected]
Subject: Re: How use a set symbol in a SET statement?

To add to the fun

// SET B=' '                   
// SET CD='cd'                 
// SET SHELL1B=&CD&B&CPPOBJ    

fails with 

40 IEFC620I UNIDENTIFIABLE CHARACTER c ON THE SET STATEMENT  

They don't make it easy.

Charles

On Fri, 24 Oct 2025 12:39:24 -0500, Charles Mills <mailto:[email protected]> 
wrote:

>I have JCL that includes the following sequence
>
> //    SET CPPOBJ='/u/userid/CertRept/Obj/'
>...
>// SET SHELL1B='cd &CPPOBJ' 
>...
>//BPXARCH  EXEC PGM=BPXBATCH,COND=(4,LT), 
>// PARM='SH&B&SHELL1B;...
>
>The BPXBATCH cd fails because &SHELL1B has the literal value cd &CPPOBJ -- in 
>other words, the path name was not substituted for the symbol name &CPPOBJ.
>
>Is there any way to set a symbol to a string that includes the value of a SET 
>symbol?
>
>If not, yeah, I can think of several possible workarounds but this seems like 
>a pretty gigantic shortcoming to me. The exclamation "Really?" comes to mind.
>
>I see an IBM-MAIN post by the sorely missed @Peter Relson from Dec 4, 2021, at 
>10:05 AM with a subject of "Re: Trying to use long parm= in started task" that 
>addresses this issue but I don't see a resolution. Is there one?
>
>Charles
--


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

Reply via email to