Criteria for renaming tape data sets

You can have Tape Optimizer rename tape data sets as they are copied to output tapes by specifying renaming criteria.

These criteria are composed of one or more pairs of "From" data-set-name masks and "To" values. Tape Optimizer matches the mask that you specify in a From field against the input tape data set names to determine which data sets to rename. Depending on how you define the "From" mask, you can rename all or some of the input tape data sets for the copy request. When the copy request runs, Tape Optimizer uses the value in the corresponding To field to generate new names for these data sets.

Restriction: Tape Optimizer does not rename any generation data sets that have a relative generation number in their names. Do not specify a relative generation number in a "From" field. To specify a "From" rename rule for a generation data set, specify a mask for the GDG base and use an asterisk (*) to match the GDG number (GxxxxVyy). Also see help for specifying tape data set selection criteria to select individual gdg tape data sets for copy. If you insert an appropriate asterisk in the To mask, the GDG number will be carried forward to the new name. If you use a (+1) in the To mask then the GDG number will be renumbered under the new base name. (see Example 5)

Tape Optimizer supports two types of wildcard characters for renaming criteria: the standard asterisk (*) wildcard and a special percent sign (%) wildcard. Both of these wildcards represent zero or more characters. However, they differ in behavior, as follows:

  • The asterisk (*) wildcard is used for "find and replace" type of renaming operations. You can specify the asterisk (*) wildcard with one or more existing data-set-name qualifiers in the From field. The asterisk (*) wildcard can appear at the beginning or end of the mask or in both locations. Tape Optimizer finds all data set names that match the "From" mask. If the wildcard is at the beginning of the mask, Tape Optimizer finds all data set names that contain the specified qualifiers anywhere in their names. In addition, you may specify an asterisk (*) anywhere with the data set mask as long as you do not specify two consecutively. An asterisk (*) contained with a node of a data set mask matches only up to the next constant part of the mask or the end of the data set node, which ever comes first. Tape Optimizer then generates new data set names by replacing the "From" qualifier string with the new qualifier string that you specify in the To field. You can specify up to the same number of asterisks (*) as you specified in the "From" field. In addition, you can specify a relative generation data set mask. Only (+1) is allowed. This tells Tape Optimizer to catalog the new name as the next number for the GDG base that matches the new name. If the GDG base does not exist, it will be created. Each data set is specifically named in the order they are selected for copy.
  • The percent sign (%) wildcard is used for "append" type of renaming operations. In the From field, you can specify the percent sign (%) wildcard by itself to select all input data sets for renaming, or specify this wildcard followed by a qualifier value (specific qualifiers or a mask) to select only the data sets names that match that qualifier value. In either case, you must also specify the percent sign (%) wildcard in the To field, either immediately preceded by or followed by the qualifier value that you want to append to the data set names.

The following examples illustrate some renaming scenarios. Examples 1 through 4 assume Backward Compatability for Rename Masks is set. See Specifying copy options for a copy request.

Example 1

Assume that the following renaming criteria are specified:

  • From: MYBRNCH.PAYROLL*
  • To: BACKUP.MYBRNCH.PAYROLL

Based on the "From" mask, Tape Optimizer finds all data set names that begin with "MYBRNCH.PAYROLL" followed by zero or more characters. Tape Optimizer renames these data sets by replacing "MYBRNCH.PAYROLL" in the data set names with the qualifiers that are specified in the "To" field. For example, if the original data set name is MYBRNCH.PAYROLL.WEEK10, the new name would be BACKUP.MYBRNCH.PAYROLL.WEEK10.

Example 2

Assume that the following renaming criteria are specified:

  • From: *MYBRNCH.PAYROLL.*
  • To: BACKUP.MYBRNCH.PAYROLL

Based on the "From" mask, Tape Optimizer finds all data set names that contain "MYBRNCH.PAYROLL" anywhere in them. These names could begin or end with "MYBRNCH.PAYROLL" or another value. Tape Optimizer renames the data sets by replacing "MYBRNCH.PAYROLL" with the qualifiers that are specified in the "To" field. For example, if the original data set name is MYCO.MYBRNCH.PAYROLL.WEEK10, the new name would be MYCO.BACKUP.MYBRNCH.PAYROLL.WEEK10.

Example 3

Assume that the following renaming criteria are specified:

  • From: %
  • To: %.BACKUP

Because the "From" field specifies only the percent sign (%) wildcard, Tape Optimizer will rename all input tape data sets. Tape Optimizer renames the data sets by appending the qualifier "BACKUP" to the end of their names. For example, if the original data set name is MYBRNCH.PAYROLL.WEEK1, the new name would be MYBRNCH.PAYROLL.WEEK1.BACKUP.

Example 4

Assume that the following renaming criteria are specified:

  • From: %.PAYROLL.*
  • To: STACKED.%.PAYROLL.BACKUP

Based on the "From" mask, Tape Optimizer finds all data set names that contain the qualifier "PAYROLL" anywhere in them. Tape Optimizer renames the data sets by replacing "PAYROLL" with "PAYROLL.BACKUP" and by adding "STACKED" to the beginning of the names. For example, if the original data set name is MYBRNCH.OPS05.PAYROLL.RD, the new name would be STACKED.MYBRNCH.OPS05.PAYROLL.BACKUP.RD.

Example 5

Assume that the following renaming criteria are specified:

  • From: %.COMP*.PAY*.*
  • To: STACKED.%.COMP*.PAY*(+1)

Based on the "From" mask, Tape Optimizer finds all data set names that contain the qualifier ".COMP" anywhere in them. All characters in the name up to that point are saved with the "%" location. Next all characters following the ".COMP" up to the next "." are saved in an internal location referenced by the "*". The next characters in the tape data set must be ".PAY". Next all characters following the ".PAY" up to the end are saved in an internal location referenced by the "*". The next node of the tape data set is a GDG number. This is also saved internally in the last "*" location. The "To" mask is used to generate the new name. The constant data is written to the new name and the saved mask "%" and "*" data is copied to their specified locations to create the new name. Due to the (+1) specification, the new GDG base is located and the next available GDG number is appended to the new data set name. For example, if the original data set name is BRNCH.COMP02.PAY0430.G0043V00, the new name would be STACKED.BRNCH.COMP02.PAY0430.G0005V00. This assumes the GDG base STACKED.BRNCH.COMP02.PAY0430 exists and the current (last) GDG number under it is G0004V00. Note that the last asterisk in the "From" mask isolates the GDG number. It is not specified in the "To" mask thus allowing a correct name to be written.