If you review the expanded JCL, I believe you will find that the first SET 
statement is part of the WOMBAT1.GEN step and the second is part of the 
WOMBAT2.GEN step.  It is not much different than DD statements which always 
belong to the step initiated by the immediately previous EXEC statement.

Moving the first SET after WOMBAT1 would produce the same results you currently 
see.  Moving just the second SET after XYZZY1 should give you what you want.  
On the other hand, placing an IEFBR14 after WOMBAT2 in the original JCL would 
provide for a more intuitive listing.

> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:[email protected]] On
> Behalf Of Paul Gilmartin
> Sent: Friday, November 06, 2015 2:17 PM
> To: [email protected]
> Subject: Premature SYMBOL substitution in SYSIN?
> 
> In the job fragment:
> 
> //*
> //  EXPORT SYMLIST=*
> //P     PROC
> //GEN   EXEC  PGM=IEBGENER
> //SYSPRINT  DD  SYSOUT=(,)
> //SYSIN     DD  DUMMY
> //SYSUT2    DD  SYSOUT=(,)
> //SYSUT1    DD  *,SYMBOLS=JCLONLY
> GENER step;
>   with V2=&V2..
> //P     PEND
> //*
> //  SET V2=WOMBAT  *************************************
> //WOMBAT1  EXEC P
> //WOMBAT2  EXEC P
> //  SET V2=XYZZY   *************************************
> //XYZZY1   EXEC P
> //XYZZY2   EXEC P
> //*
> 
> Dumping the SYSUT2s shows:
> 
> user@OS/390.24.00: head   *.GEN/*SYSUT2*
> ==> WOMBAT1.GEN/104.SYSUT2.text <==
> GENER step;
>   with V2=WOMBAT.
> 
> ==> WOMBAT2.GEN/106.SYSUT2.text <==
> GENER step;
>   with V2=XYZZY.                                                   
> ?!?!?!?!?!?!
> 
> ==> XYZZY1.GEN/108.SYSUT2.text <==
> GENER step;
>   with V2=XYZZY.
> 
> ==> XYZZY2.GEN/110.SYSUT2.text <==
> GENER step;
>   with V2=XYZZY.
> user@OS/390.24.00:
> 
> Why, in step WOMBAT2, is V2 substituted as XYZZY?  It should still
> have the value WOMBAT at that point.

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

Reply via email to