It works regardless of in stream JCL or exec proc .. The exec proc is the reason for the somewhat ridiculous nature of the JCL.
Rob On Dec 12, 2014 4:44 PM, "Nims,Alva John (Al)" <[email protected]> wrote: > Charles, > > I do not think that you need to get as complicated as Rob did. > > #1. Within a quoted string on a SET command, it treats "&FOO" as a part of > your string, not a symbol. > #2. I do not think it is necessary to put the single quote into a symbol. > > I created the JCL (listed below) and did a couple of test runs. The REXX > program just reads in the argument passed without changing it and writes it > out again. > > a) When I ran it with the "READARG" step with; PARM='%READARG &BAR1' > It Returned: Argument:/my/lower/case/uss/folder/&FOO./ > > b) When I ran it with; PARM='%READARG &BAR2.&FOO./' > it returned: Argument:/my/lower/case/uss/folder/my FOO tops yours/ > > So as you can see, syntax checking and substitution processing is > different between SET and the PARM= > > If you are wondering about the period (.) at the end of the symbol name, > that is a habit I got into some time ago, it indicates the end of the > symbol name and it avoid complications. Back when z/OS 1.6 or 1.7 came > out, it added support for performing a substring on the value of a symbol > in a JOB and coding "&DSN1(0)" to reference a GDG data set caused problems > where "&DSN1.(0)" worked. > > //** > //FOO SET FOO='my FOO tops yours' > //BAR1 SET BAR1='/my/lower/case/uss/folder/&FOO./' > //BAR2 SET BAR2='/my/lower/case/uss/folder/' > //** > //** > //GENER EXEC PGM=IEBGENR > //SYSIN DD DUMMY > //SYSPRINT DD SYSOUT=* > //SYSUT1 DD DATA,DLM=$$ > /* ---------------- REXX -- TSTSYM --------------------------------- > ------------------------------------------------------------------ */ > > PARSE ARG InVar ; > > Say "Argument:"InVar; > $$ > //SYSUT2 DD DISP=(,PASS),UNIT=SYSDA,VOL=SER=, > // DSN=&&TMPEXEC(READARG), > // SPACE=(TRK,(1,1,1)), > // RECFM=VB,LRECL=256,BLKSIZE=32760 > //* > //READARG EXEC PGM=IKJEFT01,PARM='%READARG &BAR2.&FOO./' > //SYSPROC DD DISP=(OLD,DELETE),DSN=&&TMPEXEC > //SYSTSPRT DD SYSOUT=* > //SYSTSIN DD DUMMY > > -----Original Message----- > From: IBM Mainframe Discussion List [mailto:[email protected]] On > Behalf Of Charles Mills > Sent: Friday, December 12, 2014 3:16 PM > To: [email protected] > Subject: Help please with symbols in a lower-case SET operand > > How the heck do I do this? > > I have a variable symbol &FOO that has been set to a value. I want to > include it in another set symbol like so > > // SET BAR=/my/lower/case/uss/folder/&FOO./ > > If I quote the operand it seems like &FOO does not get substituted. If I > don't quote the operand JCL barfs on the lower case letters. > > Help! > > Charles > > ---------------------------------------------------------------------- > 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 > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
