MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SET Symbol substitution for instream data in JCL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
NASCAR9
Intermediate


Joined: 08 Oct 2004
Posts: 274
Topics: 52
Location: California

PostPosted: Wed May 09, 2018 11:31 am    Post subject: SET Symbol substitution for instream data in JCL Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12368
Topics: 75
Location: San Jose

PostPosted: Wed May 09, 2018 3:06 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
NASCAR9
Intermediate


Joined: 08 Oct 2004
Posts: 274
Topics: 52
Location: California

PostPosted: Wed May 09, 2018 5:54 pm    Post subject: Reply with quote

Kolusu,
You get the 'BIG BRAIN' Award today! It worked perfectly!
Thank You Very Much!
_________________
Thanks,
NASCAR9
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group