Page 1 of 1

&SYSYEAR

PostPosted: Tue Jun 20, 2017 12:37 am
by GeorgeQ
Is there a variable can denote current year can be called directly in jcl like &sysuid? what is that? &sysyear?

Re: &SYSYEAR

PostPosted: Tue Jun 20, 2017 12:47 am
by Robert Sample
If your site uses a job scheduler, most of them have a capability to provide the date (or part of it) to the job. The native z/OS system does not have this capability, so if you're not able to use the job scheduler then you will need to use a SET statement in your JCL to manually point to the current year (and manually update it at the beginning of each new year, of course).

Re: &SYSYEAR

PostPosted: Tue Jun 20, 2017 1:15 pm
by willy jensen
As of z/OS 2.1 you can use system symbols in JCL, i.e:

//DD1      DD UNIT=SYSDA,SPACE=(TRK,1),                                              
//            DSN=WJENSEN.&SYSNAME..&SYSOSLVL..Y&LYR4                                
IEFC653I SUBSTITUTION JCL - UNIT=SYSDA,SPACE=(TRK,1),DSN=WJENSEN.S0W1.Z1020200.Y2017  
 

See the SYMBOLS parameter in the MVS JCL Reference manual. There are a few gotchas you need to beware of, mostly concerning submitting a job from one lpar to another, or submitting for later execution. See the manual for details.

Re: &SYSYEAR

PostPosted: Tue Jun 20, 2017 10:04 pm
by GeorgeQ
willy jensen wrote:As of z/OS 2.1 you can use system symbols in JCL, i.e:

//DD1      DD UNIT=SYSDA,SPACE=(TRK,1),                                              
//            DSN=WJENSEN.&SYSNAME..&SYSOSLVL..Y&LYR4                                
IEFC653I SUBSTITUTION JCL - UNIT=SYSDA,SPACE=(TRK,1),DSN=WJENSEN.S0W1.Z1020200.Y2017  
 

See the SYMBOLS parameter in the MVS JCL Reference manual. There are a few gotchas you need to beware of, mostly concerning submitting a job from one lpar to another, or submitting for later execution. See the manual for details.





Both &SYSOSLVL and &LYR4 can not be resolved...How I can check if my current system can support this symbols?

Re: &SYSYEAR

PostPosted: Tue Jun 20, 2017 11:41 pm
by Robert Sample
Both &SYSOSLVL and &LYR4 can not be resolved...How I can check if my current system can support this symbols?
Contact your site support group. You MUST be running z/OS 2.1 or higher, and your site support group must have added SYSSYM=ALLOW (the default is DISALLOW) to the specific job class you are running your batch job in. The option can be applied to * to cover all job classes, for example, but if not used for class * then it is set on a class by class basis in the JES initialization parameters.

Re: &SYSYEAR

PostPosted: Tue Jun 20, 2017 11:53 pm
by steve-myers
GeorgeQ wrote:...Both &SYSOSLVL and &LYR4 can not be resolved...How I can check if my current system can support this symbols?

You must be running z/OS 2.1 to use system symbols beyond &sysuid.

Try entering and running this little Rexx exec to tell you the OS you're currently using -

/* REXX */
SAY MVSVAR(SYSOPSYS)

Re: &SYSYEAR

PostPosted: Wed Jun 21, 2017 12:08 am
by GeorgeQ
z/OS 01.13.00 HBB7780
***

Re: &SYSYEAR

PostPosted: Wed Jun 21, 2017 12:56 am
by Robert Sample
Your site's version of z/OS does not support system symbols like &LYR4. You'll need to consider one of the other solutions that have been mentioned, at least until your site upgrades to z/OS 2.1 or 2.2.