Processing
The ACC rules can provide policies for the use of generation data groups (GDG bases) and generation datasets (GDSs). Generation datasets are treated much like any other dataset by ACC - that is, the ACC rules can provide values for characteristics such as primary and secondary space, dataset organization, DCB characteristics, and pool, storage group, or volume serial number. Usually, GDS processing by ACC takes place at allocation time, in the DD Environment. Generation data groups, or GDG bases, however, are not datasets, but catalog entries which serve to establish and manage the GDSs. These catalog entries are usually created through the use of the DEFINE GDG control statement of IDCAMS, but may also be created through other means such as TSO commands or programs. The ACC policy rules can be used to set the characteristics of GDG bases when they are defined.
The IDCAMS or TSO ALTER GDG statement can be used to change the characteristics of GDG bases after they have been defined. The ACC rules can be used to control the creation or update of GDG base entries in the same way that the generation datasets or other datasets are managed by ACC. Typically, the ACC rules might be used to enforce system policies on the use of the LIMIT, SCRATCH, FIFO, and EMPTY attributes of GDGs, as well as whether the GDG is created as extended (up to 999 generations) or non- extended (up to 255 generations).
Extended GDGs (GDG-E), which can be defined with up to 999 generations were introduced in z/OS version 2.2. ACC can be used to control the creation of GDG-Es in the same way as ordinary GDGs, and can override the default values set in the IGGCATxx member of SYS1.PARMLIB or specified on the DEFINE or ALTER GDG statement.
Activate the DEFINE_GDG
Environment
In order for ACC to receive control when GDG base entries are created or changed (usually via the IDCAMS DEFINE or ALTER GDG control statement), the DEFINE_GDG environment in ACC must be activated. This can be done by placing the following control statement in the ACC rules:
DEFENV DEFINE_GDG MODE(ACTIVE)
This statement ensures that ACC rule processing will be performed when a GDG is defined or altered.
With the DEFINE_GDG environment active, ACC rules can be used to set policies for GDG base attributes. (The DEFINE_GDG environment also applies to the IDCAMS ALTER GDG control statement or programs which attempt to alter the GDG attributes).
Note: In order for ACC to receive control at GDG DEFINE or ALTER, the ACCVSAM option must be enabled at startup time. The STARTxx member of the DIF //PARMLIB dataset should specify:
START ACC <rulename> ENABLE OPTION ACCVSAM
where ‘rulename’ is the name of the ACC //PARMLIB policy rules member to be used (the default name is ACCRULES).
Environment
The following variables may be examined or SET by the ACC rules to specify the characteristics for a GDG base:
&DSNAME - the entry name of the GDG base. A 44-character name. This value can be examined but not changed by the ACC rules.
&GDG_ALTER – is set to YES if the rules are entered for IDCAMS ALTER GDG processing or NO if the rules are entered for IDCAMS DEFINE GDG processing. This variable is read-only. Note that the Environment name (&ENV) is DEFINE_GDG even if the IDCAMS control statement is ALTER GDG.
&GDG_EMPTY – may be set to YES or NO to indicate whether the EMPTY or NOEMPTY attribute is to be used when defining the GDG. The EMPTY/NOEMPTY attribute indicates what action should be taken when a new generation is created but the LIMIT value in the GDG has been reached. The IDCAMS default is NOEMPTY if no value is specified on the DEFINE GDG statement.
&GDG_EXTENDED - this variable can be set to 'YES' to enable the creation of an Extended GDG or NO to create a non-extended GDG. The IDCAMS default value is to create a non-extended GDG. The ACC rules can set &GDG_EXTENDED to YES to create an extended GDG even if GDGEXTENDED(NO) is specified or defaulted in the IGGCATxx member of SYS1. PARMLIB.
(Note: if the EXTENDED operand is specified on the IDCAMS DEFINE statement, then GDGEXTENDED(YES) must be specified in the IGGCATxx member of SYS1.PARMLIB. Otherwise, IDCAMS will fail the define with message IDC0015I GDG EXTENDED FEATURE NOT ENABLED before ACC gets control).
&GDG_FIFO – may be set to YES or NO to indicate whether generations are to be processed in FIFO order rather than LIFO order when the GDG or GDGE is referenced by its base name (i.e., a GDG-ALL request). The IDCAMS default is whatever is specified on the DEFINE or ALTER GDG statement, or if not specified, LIFO. &GDG_FIFO can be set to YES in the ACC Rules even if GDGFIFOENABLE(NO) is specified or defaulted in the IGGCATxx member of SYS1.PARMLIB.
(Note: If the FIFO operand is specified on the IDCAMS DEFINE statement, then GDGFIFOENABLE(YES) must be set in the IGGCATxx member of SYS1.PARMLIB. Otherwise, IDCAMS will fail the DEFINE with message
IDC0010I GDG FIFO ALLOCATION ORDER FEATURE NOT ENABLED before ACC
gets control).
(Note that the FIFO or LIFO setting in the GDG may be overridden when a GDG-ALL request is processed by the GDGORDER keyword in JCL. In this case, FIFO processing is supported even if GDGFIFOENABLE(NO) is set in IGGCATxx).
&GDG_LIMIT - the maximum number of generations that can be catalogued as part of the GDG. This variable can be set to a numeric value from 1 to 255. There is no IDCAMS default. Beginning with z/OS version 2.2, the &GDG_LIMIT variable should not be used. Use &GDG_LIMITE (see below) for both extended and non-extended GDGs.
&GDG_LIMITE - the maximum number of generations that can be cataloged as part of the GDG or GDG-E. There is no IDCAMS default. This variable can be set to a numeric value from 1 to 255; for GDG-Es, the value may be up to 999. Beginning with z/OS version 2.2, when setting the limit for a GDG or GDG-E, use the &GDG_LIMITE variable rather than &GDG_LIMIT.
&GDG_PURGE – may be set to YES or NO to indicate whether to ignore expiration dates when a DASD generation is deleted or rolled off due to when the SCRATCH attribute is YES. The IDCAMS default is whatever is specified on the DEFINE or ALTER statement, or in the IGGCATxx member of SYS1.PARMLIB. If not specified in either place, the default is NO.
&GDG_SCRATCH – may be set to YES or NO to indicate whether the SCRATCH or NOSCRATCH attribute is to be used when defining the GDG. The SCRATCH/ NOSCRATCH attribute indicates whether DASD (not tape) generation data sets should be deleted (non-SMS) or rolled-off (SMS) as a result of EMPTY processing. The IDCAMS default is whatever is specified on the DEFINE or ALTER statement, or in the IGGCATxx member of SYS1.PARMLIB. If not specified in either place, the default is NO.
&OWNER – a one to eight character string identifying the GDG owner. This is the value specified in the OWNERID parameter of the DEFINE GDG statement. If no OWNERID is specified, the default value is null ("") unless the GDG is being defined as a result of a TSO command, in which case the TSO userid is used as the OWNERID. This variable may be set to any 8-character value.
(Note: &OWNER can only be SET by the ACC rules if the OWNER parameter is present in the DEFINE or ALTER GDG statement).
ACC GDG-
Related Variables in the DD
Environment
The DD Environment is entered when a generation dataset (an indivdual GDS) or a GDG- ALL request (all generations) is specified on a JCL DD statement or via dynamic allocation. In the DD environment, all of the variables that are available in the DEFINE_GDG environment above are also available, but they are read-only. In addition, the following GDG-related variables are available, in addition to all of the other variables ordinarily available in the DD Environment (such as &PSPACE, &SSPACE, &VOLSER, &UNIT, and so on).
Note that in order to process existing datasets in the ACC rules during the DD Environment, the PROCESS(DISKALL) parameter must be specified on the DEFENV statement as shown below. Otherwise, ACC will process only NEW datasets (the PROCESS default for the DD Environment is DISKNEW).
DEFENV DD MODE(ACTIVE) RULES(ALWAYS) PROCESS(DISKALL)
&GDG is set to YES or NO to indicate whether the dataset being allocated is a generation dataset. This variable is read-only.
&GDGALL is set to YES or NO to indicate whether this is a GDG-ALL request, i.e., the GDG base name is specified in the JCL to indicate that all generations of the GDG are to be processed. This variable is read-only.
&GDGBASE is set to the GDG base name for the generation data set. This variable is read-only.
&GDGORDER is set to the value specified in the GDGORDER JCL parameter, if any. If not specified, the value is null (‘’). This variable is read-only and may be any of LIFO, FIFO, USECATLG, or null. Note that GDGORDER=FIFO may be specified in JCL, and generations retrieved in FIFO order even though GDGFIFOENABLE is set to NO in the IGGCATxx member of SYS1.PARMLIB.
ACC GDG-
Related Variables in the JOB
Environment
The JOB Environment is entered at the start of job processing for a batch job or TSO user. In order to enable processing in the JOB Environment, a DEFENV statement is required in the ACC rules, e.g.:
DEFENV JOB MODE(ACTIVE) RULES(ALWAYS)
&GDGBIAS_STEP is set to YES or NO depending upon whether the GDGBIAS=STEP parameter was specified on the JOB statement or as a default in the JES job class for the job. (The z/OS default is GDGBIAS=JOB, in which case the value of &GDGBIAS_STEP is NO). The ACC rules in the JOB Environment may SET &GDGBIAS_STEP to override the current value. The &GDGBIAS_STEP variable may be interrogated in other environments such as the DD Environment, but should never be SET except in the JOB Environment. This variable is available in DIF version 7.1 and higher.
GDG Values in IGGCATxx
There are four values in the IGGCATxx member of SYS1.PARMLIB that affect the allocation and use of generation data sets. Note that these values can only be changed by restarting the catalog address space via a MODIFY CATALOG,RESTART command, or by IPL. The MODIFY CATALOG,REPORT console command can be used to display the current status of the GDG values in IGGCATxx and other catalog address space values.
GDGEXTENDED(YES/NO) allows or disallows the creation of extended GDGs (those that can have more that 255 generations). The default is NO. For ACC,GDGEXTENDED(YES) should be specified so that ACC can create extended GDGs in the DEFINE_GDG environment. (Note: The DEFINE of a GDG will fail if the ACC rules specify SET &GDG_EXTENDED = YES and the GDGEXTENDED value in IGGCATxx is NO. Also, ACC cannot directly change the format of a GDG from non-extended to extended or vice-versa. The GDG must be re-DEFINEd).
GDGFIFOENABLE(YES/NO) allows or disallows the use of FIFO order when a GDG-all request is made. That is, when the GDG is defined, the FIFO operand can be specified on the DEFINE statement to specify the order in which generations are processed for a GDG-all request.
The default, if GDGFIFOENABLE is not specified, is that FIFO processing cannot be specified when the GDG is DEFINEd (message IDC0010I GDG FIFO ALLOCATION ORDER FEATURE NOT ENABLED will result). However, the GDG can still be processed in FIFO order if GDGORDER=FIFO is specified in the JCL when the GDG-ALL request is made.
In order for the ACC rules to specify SET &GDGFIFO = YES in the DEFINE_GDG environment, then GDGFIFOENABLE must have been set to YES. The ACC rules can examine the GDGORDER= parameter in the JCL during the DD Environment but cannot change it.
GDGSCRATCH(YES/NO) specifies the default when neither SCRATCH nor NOSCRATCH is specified on the GDG DEFINE statement. If the
SCRATCH/NOSCRATCH parameter is not specified when DEFINing a GDG base, message IDC0011I GDGSCRATCH(value) SPECIFIED IN THE CATALOG
SYS1.PARMLIB MEMBER is always issued to notify the user that the default was used, if the default was set to YES. The ACC rules can override the value in the GDG_DEFINEor GDG_ALTER environments with a SET &GDG_SCRATCH= statement.
GDGPURGE(YES/NO) specifies the default when neither PURGE nor NOPURGE is specified on the GDG DEFINE statement. If PURGE/NOPURGE parameter is not specified when DEFINing a GDG base, message IDC0012I GDGPURGE(value) SPECIFIED IN THE CATALOG SYS1.PARMLIB MEMBER is always issued to notify the user that the default was taken, if the default was set to YES. The ACC rules canoverride the value in the GDG_DEFINE or GDG_ALTER environments with a SET&GDG_PURGE= statement.
GDG Example 1 – Set Extended GDG, Limit, and other attributes
The following rule sets the GDG type to extended, the maximum number of generations to 999, and the SCRATCH, LIMIT, and PURGE attributes to YES. The order in which generations are retrieved for a GDG-ALL request is set to FIFO. Messages are written to SYSPRINT to indicate the attributes that were assigned.
|
DEFPROD MSG(GENID) DEFENV DEFINE_GDG MODE(ACTIVE) |
/* INCLUDE MSGID IN MSGS | */ |
|
DEFRULE GDGRULE1 IF &DSNAME = DTS.TEST.GDG** |
/* SELECTION FILTER | */ |
| &ENV = DEFINE_GDG | /* DEFINING A GDG? | */ |
| THEN SET &GDG_EXTENDED = YES | /* MAKE IT A GDG-E | */ |
| SET &GDG_LIMITE = 999 | /* WITH MAX LIMIT | */ |
| SET &GDG_SCRATCH = YES | /* ALWAYS SCRATCH | */ |
| SET &GDG_EMPTY = YES | /* EMPTY | */ |
| SET &GDG_PURGE = YES | /* PURGE | */ |
| SET &GDG_FIFO = YES | /* SET GDG-ALL ORDER | */ |
ISSUE WRITEMSG(DTS001,DTS002,DTS003) /* TELL THE USER */
DEFMSG DTS001 'GDG-EXTENDED &DSNAME CREATED WITH LIMIT &GDG_LIMITE' DEFMSG DTS002 'ATTRIBUTES: SCRATCH=&GDG_SCRATCH EMPTY=&GDG_EMPTY' DEFMSG DTS003 'ATTRIBUTES: PURGE=&GDG_PURGE FIFO=&GDG_FIFO'
GDG Example 2 – Warn/Correct GDG Standards Violations for LIMIT
In this example, if the LIMIT value specified for a non-extended GDG is less than 255, a warning is issued and the value is set to 255. An SMF record is written to document the issue. The same processing is performed for extended GDG’s, except that the LIMIT value is set to 999.
IF
&ENV
= DEFINE_GDG
/*
DEFINING A GDG?
*/
&DSNAME = DTS.TEST.GDG**
/*
SELECTION FILTER
*/
&GDG_EXTENDED = NO
/*
NON-EXTENDED GDG?
*/
&GDG_LIMITE LT 255
/*
LESS THAN MAX?
*/
THEN SET &GDG_LIMITE = 255
/*
SET NEW LIMIT
*/
ISSUE WRITEMSG(WARNMSG)
/*
SYSPRINT WARNING
*/
ISSUE WRITESMF(WARNSMF)
/*
WRITE SMF RECORD
*/
IF
&ENV
= DEFINE_GDG
/*
DEFINING A GDG?
*/
&DSNAME = DTS.TEST.GDG**
/*
SELECTION FILTER
*/
&GDG_EXTENDED = YES
/*
NON-EXTENDED GDG?
*/
&GDG_LIMITE LE 999
/*
LESS THAN MAX
*/
THEN SET &GDG_LIMITE = 999
/*
SET NEW LIMIT
*/
ISSUE WRITEMSG(WARNMSG)
/*
SYSPRINT WARNING
*/
ISSUE WRITESMF(WARNSMF)
/*
WRITE SMF RECORD
*/
DEFENV DEFINE_GDG MODE(ACTIVE) DEFRULE LIMITRUL
DEFMSG WARNMSG '&DSNAME LIMIT OVERRIDDEN - CHECK DEFINE'
DEFSMF WARNSMF 'JOB=&JOBNAME DSN=&DSNAME LOW GDG LIMIT &GDG_LIMITE' + SMFRID(225)
GDG Example 3 – Override OWNER if specified on ALTER
IF &ENV = DEFINE_GDG
/* PROCESSING GDG BASE?
*/
&GDG_ALTER = YES
/* DOING AN ALTER?
*/
&DSNAME = DTS.TEST.GDG**
/* SELECTION FILTER
*/
&OWNER NE ''
/* OWNER SPECIFIED?
*/
&OWNER NE (STEVE,TOM,PROD*)
/* VALID OWNER?
*/
THEN SET &OWNER = STEVE
/* USE CORRECT OWNER
*/
ISSUE WRITEMSG(WARNOW)
/* AND WARN USER
*/
DEFENV DEFINE_GDG MODE(ACTIVE) DEFRULE OWNERRUL
DEFMSG WARNOW '&DSNAME ALTER FOR OWNER IGNORED'
In this example, a GDG base may be altered to a new OWNER only if the OWNER is one of a set of valid specified owners. If an invalid owner is specified, a valid one is substituted instead and a warning message is sent to SYSPRINT.
Note that for larger lists of variable values such as OWNER, it may be useful to specify a list kept in a separate ‘table’ member in the DIF parmlib, e.g.,
IF &OWNER NE TABLE(VLDOWNS) THEN action
GDG Example 4 – Prevent ALTER of the SCRATCH Attribute
In this example, an attempt to change the SCRATCH value for a GDG base to NOSCRATCH is disallowed and the step is failed with an error.
DEFENV DEFINE_GDG MODE(ACTIVE)
IF &ENV = DEFINE_GDG /* PROCESSING GDG BASE? */
| &GDG_ALTER = YES | /* DOING AN ALTER? | */ |
| &DSNAME = DTS.TEST.GDG** | /* SELECTION FILTER | */ |
| &GDG_SCRATCH EQ NO | /* SCRATCH NO? | */ |
| THEN SET &JCLFAIL = YES | /* FAIL THE ALTER | */ |
| ISSUE WRITEMSG(ERRSCR) | /* AND NOTIFY USER | */ |
DEFMSG ERRSCR '&DSNAME CANNOT BE ALTERED TO SCRATCH'
In this example, the ALTER will fail with the following messages from IDCAMS:
IDC3020I UNABLE TO ALLOCATE SPACE ON USER VOLUME
IDC3009I ** VSAM CATALOG RETURN CODE IS 68 - REASON CODE IS IGG0CLAC-176 IDC0532I **ENTRY DTS.TEST.GDG NOT ALTERED
GDG Example 5 – Prevent Use of GDGORDER in JCL
In this example, the ACC &GDGORDER variable is examined in the DD Environment to determine if GDGORDER was specified in the JCL for a GDG-ALL request. If so, the action taken depends upon what the value specified for GDGORDER was. For GDGORDER=LIFO or USECATLG, or if GDGORDER was not specified, no action is taken. If GDGORDER=FIFO is specified, the allocation is failed with an error message.
Note that the DEFENV statement enabling the DD Environment specifies PROCESS(DISKALL). This is necessary to allow ACC to process datasets allocated with a DISPosition of SHR or OLD rather than just NEW, since a GDG-ALL request is necessarily for an existing group of generation data sets. The second rule in this example (DEFRULE DDOLD) is a catchall to prevent further processing of existing datasets once the GDGALLRUL rule has been processed.
DEFENV DD MODE(ACTIVE) RULES(ALWAYS) PROCESS(DISKALL)
DEFRULE GDGALLRUL
IF &ENV = DD /* AT ALLOC TIME */
&GDGALL = YES /* GDG-ALL REQUEST? */ &DSNAME = DTS.TEST.GDG** /* SELECTION FILTER */ &GDGORDER = FIFO /* VALID VALUE? */ THEN SET &JCLFAIL = YES /* IF NOT, FAIL JOB */ ISSUE WRITEMSG(ERRORDER) /* AND ISSUE MESAGE */
DEFRULE DDOLD /* NO FURTHER PROCESSING */
IF &ENV = DD /* FOR OLD DATASETS */ &DISP1 NE NEW THEN EXIT
DEFMSG ERRORDER '&DSNAME PROCESSED MAY NOT USE &GDGORDER ORDER'