Using symbolic variables
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.
RECOVERYDSN(&DB.&TS.RP&DATE)
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 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 in the following table 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 | Definition | |
---|---|---|
&ATTACH 3 | Db2 group attachment name or subsystem ID | 4 bytes |
Current date (in the form YYMMDD) | 6 bytes | |
Current day (in the form DD) | 2 bytes | |
&DB | Database containing the space being copied | 8 bytes maximum |
&DSNUM or &PART 5 | Data set or partition being copied | 2 bytes (0-99) 3 bytes (100-999) 4 bytes (1000-4096) |
Current hour (in the form HH) | 2 bytes | |
&ICTYPE | Type of image copy
| 1 byte |
&INST | Instance number, with valid values of 01 or 02 | 2 bytes |
Current Julian date (in the form YYDDD) | 5 bytes | |
Current Julian day (in the form DDD) | 3 bytes | |
&JOBNAME | JOB name used in the JCL | 8 bytes maximum |
&LDSNUM, &LPART 5 | Data set or partition being copied (long format) | 3 bytes (000-999)4 bytes (1000-4096) |
Current minute (in the form MM) | 2 bytes | |
Current minute (in the form MM) | 2 bytes | |
Current month (in the form MM) | 2 bytes | |
&OBNOD | Object node (databaseName. spaceName, where spaceName is either a table space name or an index space name) | 17 bytes |
&PART or &DSNUM 5 | Data set or partition being copied | 2 bytes (0-99) 3 bytes (100-999) 4 bytes (1000-4096) |
&PART4 | Partition for data set allocation You can use this variable for any data set. BMC AMI Copy 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 Copy generates 5-character partition numbers as follows: Partition 1 = 00001 Partition 10 = 00010 Partition 100 = 00100 Partition 1000 = 01000 Nonpartitioned = 00000 | 5 bytes for table spaces with 4096 partitions or fewer |
Current second (in the form SS) | 2 bytes | |
Current second (in the form SS) | 2 bytes | |
&SEQ 7 | A sequence number that increments with each reference. It can be used to provide unique output data set names. The sequence number restarts at 1 for each job step. | 2 bytes |
&SSID | Db2 subsystem ID | 4 bytes |
&STEPNAME 8 | STEP name used in the JCL | 8 bytes maximum |
&TASK 7 | 1- to 2-digit number corresponding to the subtask in which a copy is made. If the copy is made in the main task, the value is 0. | 2 bytes |
Current time (in the form HHMMSS) | 6 bytes | |
&TS 9 | Table space or index space is copied | 8 bytes maximum |
&TYPE | Type of output being produced:
| 2 bytes |
&UID or &USERID | Job or TSO user ID | 7 bytes maximum |
&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 |
&UTIL 10 | Utility ID | 8 bytes maximum |
&VCAT | VCATNAME specified in the Db2 catalog for the space that you are copying; or, if the space is partitioned and the copy is DSNUM ALL, the VCAT name from the first partition that you are copying | 8 bytes |
Current year (in the form YY) | 2 bytes |
1BMC AMI Copy removes any trailing blanks in the result.
2The maximum total length allowed for a data set name is 44 bytes, except for Instant Snapshot copies, where the maximum is 39.
3This is the group attachment name if BMC AMI Copy uses one as a parameter; otherwise, BMC AMI Copy uses the subsystem ID.
4BMC AMI Copy assigns the values for these variables when the output copy data set is allocated.
5You must prefix symbols with a numeric result by one or more alpha characters.
6You can override this by using the installation options ICAUTOI and ICAUTOF.
7For information on using this symbolic variable with cabinet copies, see Considerations-for-cabinet-copies.
8BMC AMI Copy ignores PROC names.
9&TS for an index copy is the index space name. Using &TS is supported so that a single data set name can be specified for a group containing both table spaces and indexes.
10BMC AMI Copy truncates longer utility IDs to 8 characters.