Constructing rule sets
A rule set defines the VSAM data sets to be protected and environments those data sets will be selected from and saved in. To create a rule set, you construct, at a minimum, a VSAM set and job set.
Rule sets that consist of elements other than those minimum elements can be used as job-level rule sets. You can use partial job-level rule sets to override the system-level rules in effect. For example, with a partial job-level rule set, you can enlarge the size of journals for special processing needs.
When you construct and code VSAM sets and job sets, and also include user variables, journal models, skeleton JCL, internal readers, and external vendors, you have produced all of the rule set pieces available for constructing rule sets.
This topic contains the following information:
Using the ADD RULE_SET command
Use the ADD RULE_SET command to create and install a rule set to the repository. The installed rule set can be selected and activated when it is needed.
Using the JOB_SET keyword
Use the required JOB_SET keyword to provide a list of the job sets that you want to use in this job rule. (The JOB set name is the value of the JOB_SET keyword on the ADD JOB_SET statement.)
Using the VSAM_SET keyword
Use the required VSAM_SET keyword to provide a list of the VSAM sets that you want to use in this job rule. The value is one or more VSAM set names. (The VSAM set name is the value of the VSAM_SET keyword on the ADD VSAM_SET statement.)
Using the USER_VARIABLES keyword
Use the optional USER_VARIABLES keyword to provide a list of the user variable sets that you want to use in this job rule. The value is one or more user variable set names. (The user variable set name is the value of the USER_VARIABLES keyword on the USER_VARIABLES statement.)
Using the EXTERNAL_VENDOR keyword
Use the EXTERNAL_VENDOR keyword to provide a list of external vendor interfaces. See Creating-external-vendors.
Coding ADD RULE_SET statements
To code an ADD RULE_SET statement, use the following syntax:
{ JOB_SET(name32, ... ) }
{ VSAM_SET(name32, ... ) }
{ COMMENT(comment_fields) }
{ USER_VARIABLES(name32, ... ) }
{ EXTERNAL_VENDOR(name32, ... ) }
;
Use the value of the RULE_SET keyword to define the name of the rule set (see the example that follows). This name is the name that you use as the value of the RULE_SET keyword on an ACTIVATE RULE_SET statement.)
COMMENT("Test GNL rules")
JOB_SET(PROD_GNL
$DEFAULT_EXCLUDES)
VSAM_SET(PROD_GNL
$EXCLUDES)
USER_VARIABLES(PROD_VARIABLES)
EXTERNAL_VENDOR($DEFAULT)
;
Sample construction of a rule set
This section provides a sample of how to construct a rule set that will cause batch journaling and logging of VSAM files. You will modify the rule set example (see the example figure in step 1) to match with your batch journaling requirements. Perform the following process to create a sample rule set:
Print and examine the example JCL found in the $DEFAULT member of the RUV.CNTL library as shown in the following figure:
. . . . . . . . . . . . . . . . . .
DELETE VSAM_SET($SAMPLE);
ADD VSAM_SET($SAMPLE)
COMMENT("SAMPLE JOB RULE"
"BMC Software"
)
* DSN JOURNAL OPTIONS
VSAM_RULE(NAME.VSAM.DSN BOTH)
;
DELETE JOB_SET($SAMPLE);
ADD JOB_SET($SAMPLE)
COMMENT("SAMPLE VSAM RULE"
"BMC Software"
)
* JOB NAME PROGRAM NAME
JOB_RULE(YOURJOB YOURPGM
JOURNAL_ABEND(CONTINUE)
)
;
DELETE RULE_SET($SAMPLE);
ADD RULE_SET($SAMPLE)
COMMENT("SAMPLE VSAM RULE")
JOB_SET($DEFAULT
* PLACE YOUR JOB SET ENTRIES HERE
$EXCLUDE_ALL)
VSAM_SET($DEFAULT
* PLACE YOUR VSAM SET ENTRIES HERE
$EXCLUDE_ALL)
USER_VARIABLES($DEFAULT)
;$DEFAULT will be in the repository if you completed the installation IVP tasks.
The following command set will print $DEFAULT:
SET REPORT(DETAIL);
REPORT RULE_SET($DEFAULT)
JOURNAL_MODEL($DEFAULT)
INTERNAL_READER($DEFAULT)
JOB_JCL($DEFAULT);For other rule set examples, print and examine the sample VSAM_SET and JOB_SET members that are provided in the $SAMPLE member of the RUV.CNTL library. Print them with the following command set:
SET REPORT(DETAIL);
REPORT VSAM_SET($SAMPLE);
REPORT JOB_SET($SAMPLE);- Create a copy of member $SAMPLE of the RUV.CNTL library as shown in the example figure in step 1. Change all of the $SAMPLE labels to the 32-character labels of your choice. In the example, use element_TESTING, where element is for a JOB, VSAM, or RULE set label. Modify the optional comments as appropriate.
- Under the ADD VSAM_SET section, find VSAM_RULE and replace NAME.VSAM.DSN with the name of the VSAM file to be journaled (TST.RUV.SAMPLE). The VSAM rule also uses the parameter BOTH to specify that both before and after-images are to be recorded for this file.
- Under the ADD JOB_SET section, find JOB_RULE and replace YOURJOB with TST*. The asterisk character ‘*’ is a wildcard specification character that allows you to cover many jobs with a single rule.
Also under the ADD JOB_SET section in, find JOB_RULE and replace the program name YOURPGM with TESTAPP. (TESTAPP is the name of the application that uses the TST.RUV.SAMPLE file.)
This job rule accepts the default site specifications for journaling output and recovery JCL. It also requests that the job be allowed to continue if an error occurs while journaling by using the JOURNAL_ABEND(CONTINUE) keyword. - After the $DEFAULT entry under the ADD RULE_SET section, replace the comment lines as indicated with the JOB_SET and VSAM_SET 32-character labels you chose in procedure 2.
- Before you use it, store the completed sample in the repository. The JCL shown in the figure in step 7 will save the new rules in the repository.
Activate and test the rule set you have just built to verify its structure and flow. For more information, see Activating-a-rule-set and Testing-a-rule-set.
The following figure shows the modified rule set $DEFAULT://LOADSAMP EXEC PGM=RUVZSM0
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
* ignore errors on the delete
SET TERM_CC(8);
DELETE VSAM_SET(VSAM_TESTING);
ADD VSAM_SET(VSAM_TESTING)
COMMENT("TEST VSAM FILES”
“DEPT 87”
"EXT. 1984"
)
* DSN JOURNAL OPTIONS
VSAM_RULE(TST.RUV.SAMPLE BOTH)
;
DELETE JOB_SET(JOB_TESTING);
ADD JOB_SET(JOB_TESTING)
COMMENT("TEST VSAM FILES”
“DEPT 87”
"EXT. 1984"
)
* JOB NAME PROGRAM NAME
JOB_RULE (TST* TESTAPP)
JOURNAL_ABEND(CONTINUE)
)
;
DELETE RULE_SET(RULE_TESTING);
ADD RULE_SET(RULE_TESTING)
COMMENT("SAMPLE VSAM RULE")
JOB_SET($DEFAULT
JOB_TESTING
$EXCLUDE_ALL)
VSAM_SET($DEFAULT
VSAM_TESTING
$EXCLUDE_ALL)
USER_VARIABLES($DEFAULT)
;The rule set construction sample process you used is a beginning to developing comprehensive and more complex rule sets. Remember to develop the rule sets in a logical and orderly manner.
The labeling scheme that you develop for your rule set names is important and should be worked out independently of the coding process. Creating the 32-character rule set labels connects various elements together. By learning the connection between elements, you will find reusing the names to be a logical and convenient process.
The following figure illustrates the recommended general order of the rule set coding process (rule set build and activation flow). It also illustrates the need to carefully label elements as they are created and reused in the rule set construction process.
Related topic