The rules file is a text file that can include multiple rules. You can set conditions on specific field names and define multiple conditions within a single rule.
A rule is defined using the following format:
RULE: - CONDITION: condition VALUE: value SUBDIRECTORY: location ---
Where:
A rule can have multiple conditions.
A rule can have only one SUBDIRECTORY: entry.
The following is example of a rule that sets a condition for the RECORDTYPE property with a value of 'S'. This indicates that any SPOOL file should be assigned to the $MFSYSCATDIR\SPOOL\ folder ($MFSYCATDIR is an environment variable that indicates the folder that stores the system catalog):
RULE: - CONDITION: RECORDTYPE VALUE: S SUBDIRECTORY: $MFSYSCATDIR\SPOOL\ ---
The following names can be used in the rules to indicate catalog record fields:
You can define multiple conditions within a single rule.
The following example shows a rule for a dataset that has a character set of ASCII; its dataset name has 'PROD' as its first element and 'I' as its fourth element (for example, PROD.BBBB.CCCC.I.EEEE); has a UNIT setting of 'SYSDA'; a RECFM setting of 'VB'; was created by the JCL job 'OVERCHK'; will be created in the '$MFSYSCATDIR\RECFM\' folder:
RULE: - CONDITION: CHARSET VALUE: A - CONDITION: DSNAME1 VALUE: PROD - CONDITION: DSNAME4 VALUE: I - CONDITION: UNIT-DEVICE VALUE: SYSDA - CONDITION: RECFM VALUE: VB - CONDITION: JOB-CREATED VALUE: OVERCHK SUBDIRECTORY: $MFSYSCATDIR\RECFM\ ---
You can use hexadecimal values in the rules.
The following example shows a rule that is defined for the dataset LRECL field - if it has a value of H'0063' (decimal 99), it will be assigned to the LRECL99 folder:
RULE: - CONDITION: LRECL VALUE: HEXVALUE 0063 SUBDIRECTORY: $MFSYSCATDIR\LRECL99\ ---
The rules file has a simple wildcard support. You can use a single or multiple wildcards, *, in the value field to indicate any number of characters - for example, L00*500 or *TE*.**S*.
The following example rule specifies that a dataset whose first name element is ‘PROD’ and whose management class begins with ‘L00’ and ends with ‘500’ is to be assigned to the L00D500 folder:
RULE: - CONDITION: DSNAME1 VALUE: PROD - CONDITION: MGMTCLASS VALUE: L00*500 SUBDIRECTORY: $MFSYSCATDIR\L00D500\ ---
The format of the rules file enables you to assign properties to a dataset based on the same conditions. This can be likened to the Automatic Class Selection process on the mainframe.
You can assign the following attributes to a dataset:
The following example shows a rule that specifies that any dataset that has a first name element of ‘MFI01’ and a fourth name element of ‘F2’ is to be assigned to the $MFSYSCATDIR\MFI01\ENDINF2 folder and have the MANGEMENGTCLASS property set to ‘MGMTYYYY’ and the EXPIRY date set to 4 days hence (a specific value can also be used):
RULE: - CONDITION: DSNAME1 VALUE: MFI01 - CONDITION: DSNAME4 VALUE: F2 SUBDIRECTORY: $MFSYSCATDIR\MFI01\ENDINF2 - ATTRIBUTE: MGMTCLASS VALUE: MGMTYYYY - ATTRIBUTE: EXPIRE VALUE: +4 ---
For more examples of the allocation rules, see the Mainframe Samples available with this product - Start > All Programs > Micro Focus Enterprise Developer > Mainframe Samples, and select the JCL – Allocation Override sample.