View previous topic :: View next topic |
Author |
Message |
NASCAR9 Intermediate
Joined: 08 Oct 2004 Posts: 274 Topics: 52 Location: California
|
Posted: Wed May 09, 2018 11:31 am Post subject: SET Symbol substitution for instream data in JCL |
|
|
I'm trying to set a variable in a job that is repeated 8 times. The change happens daily.
Code: |
// SET EPRM='.SPL-08MAY2018'
**** This is loaded into a dataset Via PGM=EZACFSM1
XXXX\XXXXFTP
XXXX
CD YYYY YYYYY
SENDSITE
PUT //DD:IN0001 +
RETRECDALL&EPRM.&DAY.
QUIT
**** This is the result in the file
XXXX\XXXXFTP
XXXX
CD YYYY YYYYY
SENDSITE
PUT //DD:IN0001 +
RETRECDALL&EPRM.09
QUIT
|
The &DAY. is working perfect. This variable is only being used for testing.
The &EPRM. is not working.
Can someone help? _________________ Thanks,
NASCAR9 |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12368 Topics: 75 Location: San Jose
|
Posted: Wed May 09, 2018 3:06 pm Post subject: |
|
|
NASCAR9,
&DAY is a system symbol and hence it is substituted, where EPRM is user variable and unless you use EXPORT, you cannot pass it to the sysin.
Something like this (You would need z/OS 2.1 and higher for the EXPORT to work
Code: |
// EXPORT SYMLIST=(EPRM)
// SET EPRM='.SPL-08MAY2018'
//*
//STEP0100 EXEC PGM=EZACFSM1
//SYSOUT DD SYSOUT=*
//SYSIN DD DATA,DLM=@@,SYMBOLS=JCLONLY
**** THIS IS LOADED INTO A DATASET VIA PGM=EZACFSM1
XXXX\XXXXFTP
XXXX
CD YYYY YYYYY
SENDSITE
PUT //DD:IN0001 +
RETRECDALL&EPRM.&DAY.
QUIT
@@
|
The output from this is
Code: |
**** THIS IS LOADED INTO A DATASET VIA PGM=EZACFSM1
XXXX\XXXXFTP
XXXX
CD YYYY YYYYY
SENDSITE
PUT //DD:IN0001 +
RETRECDALL.SPL-08MAY201809
QUIT |
Check this link which explains in detail about Symbols
https://www.ibm.com/developerworks/community/blogs/5things/entry/5_things_to_know_about_using_symbols_in_jcl_in_z_os_v2r1?lang=en _________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
NASCAR9 Intermediate
Joined: 08 Oct 2004 Posts: 274 Topics: 52 Location: California
|
Posted: Wed May 09, 2018 5:54 pm Post subject: |
|
|
Kolusu,
You get the 'BIG BRAIN' Award today! It worked perfectly!
Thank You Very Much! _________________ Thanks,
NASCAR9 |
|
Back to top |
|
|
|
|