&SYSYEAR



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

&SYSYEAR

Postby GeorgeQ » Tue Jun 20, 2017 12:37 am

Is there a variable can denote current year can be called directly in jcl like &sysuid? what is that? &sysyear?
GeorgeQ
 
Posts: 27
Joined: Fri Jun 16, 2017 1:08 am
Has thanked: 11 times
Been thanked: 0 time

Re: &SYSYEAR

 

Re: &SYSYEAR

Postby Robert Sample » Tue Jun 20, 2017 12:47 am

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).

These users thanked the author Robert Sample for the post:
GeorgeQ (Tue Jun 20, 2017 1:04 am)
Robert Sample
Global moderator
 
Posts: 3363
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 221 times

Re: &SYSYEAR

Postby willy jensen » Tue Jun 20, 2017 1:15 pm

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.
willy jensen
 
Posts: 119
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 18 times

Re: &SYSYEAR

Postby GeorgeQ » Tue Jun 20, 2017 10:04 pm

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?
GeorgeQ
 
Posts: 27
Joined: Fri Jun 16, 2017 1:08 am
Has thanked: 11 times
Been thanked: 0 time

Re: &SYSYEAR

Postby Robert Sample » Tue Jun 20, 2017 11:41 pm

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.
Robert Sample
Global moderator
 
Posts: 3363
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 221 times

Re: &SYSYEAR

Postby steve-myers » Tue Jun 20, 2017 11:53 pm

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)
steve-myers
Global moderator
 
Posts: 1875
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 193 times

Re: &SYSYEAR

Postby GeorgeQ » Wed Jun 21, 2017 12:08 am

z/OS 01.13.00 HBB7780
***
GeorgeQ
 
Posts: 27
Joined: Fri Jun 16, 2017 1:08 am
Has thanked: 11 times
Been thanked: 0 time

Re: &SYSYEAR

Postby Robert Sample » Wed Jun 21, 2017 12:56 am

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.
Robert Sample
Global moderator
 
Posts: 3363
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 221 times


Return to JCL