&SYSYEAR

JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...
GeorgeQ
Posts: 28
Joined: Fri Jun 16, 2017 1:08 am
Skillset: SAS jcl
Referer: Kevin

&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?

Robert Sample
Global moderator
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
Referer: other forum
Location: Dubuque, Iowa, USA

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

willy jensen
Posts: 474
Joined: Thu Mar 10, 2016 5:03 pm
Skillset: assembler rexx zOS ispf racf smf
Referer: saw it in the experts foprum thought I could help here

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:

Code: Select all


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

GeorgeQ
Posts: 28
Joined: Fri Jun 16, 2017 1:08 am
Skillset: SAS jcl
Referer: Kevin

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:

Code: Select all


//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?

Robert Sample
Global moderator
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
Referer: other forum
Location: Dubuque, Iowa, USA

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.

steve-myers
Global moderator
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Skillset: Assembler, JCL, utilities
Referer: zos.efglobe.com

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)

GeorgeQ
Posts: 28
Joined: Fri Jun 16, 2017 1:08 am
Skillset: SAS jcl
Referer: Kevin

Re: &SYSYEAR

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

z/OS 01.13.00 HBB7780
***

Robert Sample
Global moderator
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
Referer: other forum
Location: Dubuque, Iowa, USA

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.