GDGs and symbolic variables in data set name construction
When dynamic allocation is used, BMC AMI Recover also provides the option of specifying an input data set, AFRGDG, to provide control cards to be used to define the GDG base if it does not already exist. This data set must contain the control cards to perform an IDCAMS DEFINE, and the symbolic variable, &BASE, which BMC AMI Recover replaces with the GDG base name. For example:
NOEMPTY NOSCRATCH)
Using symbolic variables
You can also use symbolic variables when you specify a data set name in an output descriptor.
You can represent the variable elements shown in the table below by using symbolic variables.
You can specify any or all nodes of a data set name by using symbolic variables as in the following example:
This example generates data set names containing the ID of the user making the copies, the space being copied, and the type of copy. Another example follows:
This example combines a real node name with symbolic variables to generate a data set name.
Symbols for numeric variables (&DATE, &TIME, &JDATE, &YEAR, &MONTH, &DAY, &JDAY, &HOUR, &MINUTE, &SECOND, &SEQ, &DSNUM, &LDSNUM, &PART, and &LPART) must be prefixed by a Latin alphabetic character. In the following example, the first statement causes errors, while the second is correct:
Correct: DSNAME &DB.&TS.RP&DATE
The DSNAME pattern supports symbolic variables. While it allows two variables to be concatenated, it does not allow the user to append text to the end of a variable, and the product discards any such text.
You can use the concatenation operator (||) to append text to symbolic variables. For example, &TS||XX.
We support the concatenation operator wherever we support dataset name patterns, including (but not necessarily limited to) the following:
- OUTPUT descriptor dsname
- OUTCOPYDSN
- RECOVERYDSN
- INCOPY MODEL
(BMC.DB2.SPE2410) Although you can prefix a symbolic variable with an alphabetic character, you cannot append characters. If you append any characters or numbers after the symbolic variable, those characters or numbers are ignored and are not used. For example, XX&TS is valid, but &TSXX is invalid. &TS.XX is also valid. You can use the concatenation operator (||) to append characters after a symbolic variable. For example, &TS||XX is valid.
You can also use substrings of symbolic variables in data set names in the format symbolicVariable(n,m), where the substring starts with character n for a length of m characters. In the following example, 2 is the substring starting position and 4 is the substring length.
You can use symbolic variables with GDGs simply by appending the generation number in parentheses in the usual way. For example, &TS(+1).
Symbolic variables for specifying data set names
Symbolic variable | Description | |
---|---|---|
&JOBNAME | JOB name used in the JCL | 8 bytes maximum |
&STEPNAM | STEP name used in the JCL (PROC names are ignored) | 8 bytes maximum |
&VCAT | VCAT name for the space | 8 bytes maximum |
&DB | Database containing the space | 8 bytes maximum |
&TS | Table space or index space 3 | 8 bytes maximum |
&SP | Table space or index space | 8 bytes maximum |
Data set or partition being copied | 2 bytes for 0 - 99 3 bytes for 100 - 999 4 bytes for 1000 - 4096 | |
&LDSNUM, &LPART 4 | Data set or partition being copied | 3 bytes for 000-999 4 bytes for 1000-4096 |
&USERID or &UID | Job or TSO user ID | 7 bytes maximum |
&SSID | Db2 subsystem ID | 4 bytes |
&ATTACH 4 | Db2 group attachment name or subsystem ID | 4 bytes |
Current date (in the form YYMMDD) | 6 bytes | |
Current time (in the form HHMMSS) | 6 bytes | |
Current Julian date (in the form YYDDD) | 5 bytes | |
Current year (in the form YY) | 2 bytes | |
Current month (in the form MM) | 2 bytes | |
Current day (in the form DD) | 2 bytes | |
Current Julian day (in the form DDD) | 3 bytes | |
Current hour (in the form HH) | 2 bytes | |
Current minute (in the form MM) | 2 bytes | |
Current second (in the form SS) | 2 bytes | |
&ICTYPE | Type of image copy:
| 1 byte |
&UTIL | Utility ID | 8 bytes maximum 8 |
&SEQ | A sequential number that restarts at 1 at the beginning of each job step execution | 2 bytes |
&TYPE9 | Type of output being produced:
| 2 bytes |
&PART4 | Partition for data set allocation You can use this variable for any data set. BMC AMI Recover generates 4-character partition numbers as follows: Partition 1 = 0001 Partition 10 = 0010 Partition 100 = 0100 Nonpartitioned = 0000 | 4 bytes for table spaces with 4096 partitions or fewer |
&PART5 | Partition for data set allocation You can use this variable for any data set. BMC AMI Recover generates 5-character partition numbers as follows: Partition 1 = 00001 Partition 10 = 00010 Partition 100 = 00100 Partition 1000 = 01000 Nonpartitioned = 00000 Example: ABC.DSN1.DA.&DB.&TSIX..P&PART5 BMC AMI Recover generates the following 5-character partition number for partition 4096: ABC.DSN1.DA.DBNAME.TSNAME.P04096 | 5 bytes for table spaces with 4096 partitions or less |
&INST | Instance number, with valid values of 1 or 2 | 1 bytes |
&UNIQ or &UQ | 1- to 8-character value, based on the system clock, that is used to generate unique copy data set names The first character is always an uppercase letter. Each remaining character is either an uppercase letter or a numeral from 0 through 9. | 8 bytes maximum |
1 Any trailing blanks in the result are removed.
2 The maximum total length allowed for a data set name is 44 bytes.
3 &TS for an index copy is the index space name. Using &TS is supported, so you can specify a single data set name for a group containing both table spaces and indexes.
4 You must prefix symbols with a numeric result with one or more alphabetical characters.
5
When used in an INDEP OUTSPACE MODEL statement, &DSNUM and &PART resolve to a 4-byte partition identifier for the data set node according to the following scheme:
- A001 through A999 for partitions 1 through 999
- B000 through B999 for partitions 1000 through 1999
- C000 through C999 for partitions 2000 through 2999
- D000 through D999 for partitions 3000 through 3999
- E000 through E096 for partitions 4000 through 4096
6
This is the group attachment name if one is used as an
BMC AMI Recover
parameter; otherwise, the subsystem ID is used.
7
The values for these variables are assigned when the output copy data set is allocated.
8
Longer utility IDs are truncated to eight characters.
9
The behavior of &TYPE in an INCOPY MODEL statement is undefined because INCOPY doesn't have an associated site type. We recommend not using &TYPE in an INCOPY MODEL statement.