I tried the sample from IBM Manual and it seems it works as designed. I've not read properly so sorry about that.
This JCL works the way you want: //*-------------------------------------------------------------------* //STP01 EXEC PGM=ICEGENER //SYSPRINT DD DUMMY //SYSUT1 DD *,SYMBOLS=(JCLONLY) &PRM /* //SYSUT2 DD SYSOUT=* //*-------------------------------------------------------------------* //TOSTP01 SET PRM='PARM1' //*-------------------------------------------------------------------* //STP02 EXEC PGM=ICEGENER //SYSPRINT DD DUMMY //SYSUT1 DD *,SYMBOLS=(JCLONLY) &PRM /* //SYSUT2 DD SYSOUT=* //*-------------------------------------------------------------------* //TOSTP02 SET PRM='PARM2' //*-------------------------------------------------------------------* //STP03 EXEC PGM=ICEGENER //SYSPRINT DD DUMMY //SYSUT1 DD *,SYMBOLS=(JCLONLY) &PRM /* //SYSUT2 DD SYSOUT=* //*-------------------------------------------------------------------* //TOSTP03 SET PRM='PARM3' It seems the SYMBOLS substitution happens at a different "step" by the translator. Even it seems crazy, the TOSTP03 SET work for STP03. As Paul said, I think IBM will respond "it works as designed". Regards. Il giorno lun 30 mar 2020 alle ore 13:51 Windt, W.K.F. van der (Fred) < 00000185ecbb3806-dmarc-requ...@listserv.ua.edu> ha scritto: > Based on the doc I expected these two JCL variations to behave 100% > equivalent (assuming the program van handle any parameter length): > > //STEP1 EXEC PGM=program,PARM='parameter with symbols' > > And > > //STEP1 EXEC PGM=program,PARM=PARMDD > //PARMDD DD *,SYMBOLS=JCLONLY > parameter with symbols > /* > But unexpected stuff happens when you add SET statements between job steps. > > // SET VRB=VALUE1 > //STEP1 EXEC PGM=program,PARM='&VRB' > //* > // SET VRB=VALUE2 > //STEP2 EXEC PGM=program,PARM='&VRB' > //* > // SET VRB=VALUE3 > //STEP3 EXEC PGM=program,PARM='&VRB' > > Behaves as expected. In STEP1 the program in invoked with parameter > VALUE1, in STEP2 with parameter VALUE2 and in STEP3 with parameter VALUE3. > > If I change the JCL to this: > > // SET VRB=VALUE1 > //STEP1 EXEC PGM=program,PARM=PARMDD > //PARMDD DD *,SYMBOLS=JCLONLY > &VRB > /* > //* > // SET VRB=VALUE2 > //STEP2 EXEC PGM=program,PARM=PARMDD > //PARMDD DD *,SYMBOLS=JCLONLY > &VRB > /* > //* > // SET VRB=VALUE3 > //STEP3 EXEC PGM=program,PARM=PARMDD > //PARMDD DD *,SYMBOLS=JCLONLY > &VRB > /* > > Does not behave 'logical' at all. In STEP1 the program is invoked with > parameter VALUE2, in STEP2 and STEP3 with parameter VALUE3. It seems SET > statement that follow the current EXEC statement (but before the next EXEC > statement) are processed before the PARMDD= parameter is constructed. > > I can't find any documentation that specifies this behavior. Is this a bug? > > Regardz, > > Fred! > > ----------------------------------------------------------------- > ATTENTION: > The information in this e-mail is confidential and only meant for the > intended recipient. If you are not the intended recipient, don't use or > disclose it in any way. Please let the sender know and delete the message > immediately. > ----------------------------------------------------------------- > > ---------------------------------------------------------------------- > 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