ACC variables and processing for dataset encryption - Latest

Syncsort™ Storage Management Allocation Control Center and Space Recovery System Guide

Product type
Software
Portfolio
Integrate
Product family
Syncsort™ software
Product
Syncsort™ Storage Management > Syncsort™ Space Recovery System
Syncsort™ Storage Management > Syncsort™ Allocation Control Center
Version
Latest
ft:locale
en-US
Product name
Syncsort Storage Management
ft:title
Syncsort™ Storage Management Allocation Control Center and Space Recovery System Guide
Copyright
2026
First publish date
1991
ft:lastEdition
2026-04-01
ft:lastPublication
2026-04-01T09:40:09.707000
L1_Product_Gateway
Integrate
L2_Product_Segment
IBM Infrastructure
L3_Product_Brand
Precisely Syncsort
L4_Investment_Segment
Mainframe
L5_Product_Group
Mainframe Storage Optimization
L6_Product_Name
Syncsort Storage Management

ACC receives control and can execute policy rules to take actions whenever a new dataset is created, and optionally when an existing dataset is accessed, i.e., whenever any dataset is allocated or used by a job step. Almost all attributes related to datasets, such as primary and secondary space, DCB characteristics, SMS classes, DISPosition, and so on, can be examined, and in most cases, altered by ACC policy rules. Among the variables that can be used by ACC rules are those related to DASD dataset encryption. The encryption key label, in particular, can be examined and used by ACC rules for many purposes, including validation and standards enforcement such as:

  • ensuring that a new (or old) dataset is assigned an encryption key label
  • validating that encryption key label is appropriate for a particular dataset
  • allowing or disallowing the use of JCL/IDCAMS specifications of some or all key labels
  • preventing the use of specified key labels
  • performing other validation or enforcing other standards

&DSKEYLBL is a read/write variable that indicates the key label (if any) specified when a dataset is allocated. For a NEW dataset, this will be the key label from one of the following sources:

  • RACF – the key label specified in the DFP segment of the dataset profile
  • JCL/IDCAMS – the key label specified in the DSKEYLBL parameter in JCL or in the IDCAMS DEFINE or ALLOCATE control statements.
  • SMS – the key label specified in the data class assigned to the dataset

The above is the precedence order in which the system assigns a key label. If there is a key label present in the DFP segment of the RACF profile, it takes precedence and cannot be overridden. If no key label is specified in the dataset profile, then the key label specfied in the JCL or IDCAMS control statement is used, and if there is none, then the key label from the data class is used, if a data class is assigned to the dataset by the SMS ACS routines. If no key label is present in the dataset profile, the JCL/IDCAMS statements, or the SMS data class, then the dataset is not encrypted.

The IDCAMS ‘ALTER’ statement cannot be used to change a key label.

Using ACC Rules with Key Labels

Validating DSKEYLBL for IDCAMS DEFINE

IDCAMS reads SYSIN and builds an SVC 26 parameter list in order to DEFINE a VSAM cluster. When building the parameter list, IDCAMS includes the key label specification. If the cluster being created has a RACF dataset profile with a key label, that key label – the one in the profile, is placed into the parameter list rather than any key label specified in the DEFINE control statement. Since ACC receives control at SVC 26 time rather than directly from IDCAMS, the &DSKEYLBL variable will contain the value from the RACF profile (if there is one) rather than the value specified in the DEFINE. Thus it is not possible in the ACC IDCAMS environment to determine what value was specified for DSKEYLBL in the DEFINE control statement if the dataset is covered by a RACF profile.

However, when the ACS Storage Group routine is called to select a volume for the dataset, the ACS routine variable DSKEYLBL actually does contain the value specified in the IDCAMS DEFINE statement rather than the value from the RACF profile. So it is possible to validate a key label specified in an IDCAMS DEFINE by enabling the ACC SMSACS environment and using the &SMSACS_DSKEYLBL variable, as shown below.

(Note that DSKEYLBL cannot be SET at SMSACS time – it can only be SET in the IDCAMS environment).

DEFENV SMSACS MODE(ACTIVE) RULES(ALWAYS) DEFRULE TESTKEY CONTINUE(NEXTIF)

IF &ENV = SMSACS &JOBNAME = SJP1* &DSNAME = TESTKEY** &DSORG = VS

&SMSACS_DSKEYLBL EQ SOME.INVALID.LABEL.FROM.DEFINE** THEN ISSUE SET &JCLFAIL = YES

ISSUE WRITEMSG(BADKEY)

DEFMSG BADKEY '** ERROR: KEY LABEL &SMSACS_DSKEYLBL NOT ALLOWED'

Consideration

The ACC rules can use &DSKEYLBL to determine whether a key label was specified in JCL or IDCAMS. (For IDCAMS, &SMSACS_DSKEYLBL will need to be used in the SMSACS environment, if the dataset is covered by a RACF profile with a key label). The ACC rules can also SET a value for the key label. There is an additional consideration for SETting &DSKEYLBL for VSAM datasets, however. For VSAM datasets, ACC cannot supply a key label value if one is not present. That is, for VSAM, the ACC rules can SET &DSKEYLBL but this will only be effective if a key label was present in the RACF dataset profile, on the IDCAMS control statement or in the SMS data class. This is because ACC updates the key label value in the SVC 26 parameter list, and can only update the key label value if one is present. Also, unlike the non-VSAM case, an ACC SET statement for &DSKEYLBL can override a key label value from the RACF dataset profile.

Removing (Nullifying) a Key Label

The ACC rules can be used to set the value of DSKEYLBL specified in JCL ( for which no key label is present in the RACF dataset profile) to null. Doing so may be useful to prevent attempts by users to override data class specifications, or to assure that the key label used is always from the data class.

Note: The &DSKEYLBL variable should not be set to null for VSAM datasets. Doing so will set the key value to blanks but will not properly prevent the dataset from being encrypted.

The example below shows a key label specified in JCL for non-VSAM datasets being set to null. This allows the value specified in the data class to be assigned, if it is an

appropriate one. If the value in the data class is not appropriate, a warning message is issued but the allocation is allowed to proceed.

DEFRULE KEYNULL

IF &JOBNAME = ABC* &DSKEYLBL NE '' &RACF_DSKEYLBL = ''

THEN DO

IF &DC_DSKEYLBL = (GOOD.KEY.LABEL1, GOOD.KEY.LABEL2) THEN SET &DSKEYLBL = ''

ISSUE WRITEMSG(IGNKEY)

IF &DC_DSKEYLBL = (BAD.KEY**) THEN ISSUE WRITEMSG(BAD-

KEY) END

DEFMSG IGNKEY 'SPECIFIED KEY &DSKEYLBL IGNORED, DATA CLASS USED'

DEFMSG BADKEY 'BAD KEY, &DSKEYLBL, ALLOCATION PROCEEDS'

The &CAT_DSKEYLBL variable contains the key label assigned to the catalog entry for the dataset. It may be useful in detecting situations where undesired key labels have been assigned. In the example below, an SMF record is written if the key label in the catalog differs from that in the dataset’s RACF profile.

DEFENV DD PROCESS(DISKALL)

DEFRULE CATKRULE CONTINUE(NEXTIF) IF &DSNAME = PROD.**

&ENV = DD

&DISP1 = (OLD,SHR) &CAT_DSKEYLBL NE &RACF_DSKEYLBL THEN ISSUE WRITESMF(MKEYSMF)

IF &DISP1=(OLD,SHR) THEN EXIT

DEFSMF MKEYSMF 'JOB=&JOBNAME STEP=&STEPNAME DSN=&DSNAME KEY LABEL MISMATCH'

Displaying DSKEYLBL

Variable Values

Since there are several different ACC variables that may contain or be related to encryption key labels, it may be useful to use a special ‘test’ rule to display the values of these variables when the policy rules are invoked. An example of such a rule, which uses

the DEFMSG statement to display variable values, is shown below. This technique can be used in many other instances for ACC rules debugging.

DEFRULE TESTRULE IF &JOBNAME = JOBX

&DSNAME = SOME.INTERESTING.DSN

THEN ISSUE WRITEMSG(M0,M1,M2,M3,M4,M5,M6)

DEFMSG M0 '** STEP=&STEPNAME ENV=&ENV &ENVS DSN=&DSNAME ' DEFMSG M1 'DSKEYLBL=&DSKEYLBL DISP1=&DISP1'

DEFMSG M2 'SMSACS_DSKEYLBL=&SMSACS_DSKEYLBL' DEFMSG M3 'RACF_DSKEYLBL=&RACF_DSKEYLBL' DEFMSG M4 'CAT_DSKEYLBL=&CAT_DSKEYLBL' DEFMSG M5 'DC_DSKEYLBL=&DC_DSKEYLBL'

DEFMSG M6 ' '

It may be useful to precede this rule with one that sends message output to the console, as shown below.

DEFPROD MSG(LEVEL(I) WTORC(2,11))