GDGs and symbolic variables in data set name construction


You can use generation data set groups (GDGs) and symbolic variables to simplify the task of data set name construction when you use dynamic allocation with BMC AMI Recover.

You can use a GDG and symbolic variables together in a data set name.

Using GDGs

The GDG format that you use in data set name construction is the same as the format that you use in JCL when you use DD statements to allocate your copy data sets.

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:

DEFINE GDG(NAME(&BASE) LIMIT(7) -
 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:

DSNAME &UID.&TS.&TYPE

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:

DSNAME NEWYEAR.&DB.&TS

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:

Incorrect: DSNAME &DB.&TS.&DATE

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.

&DBNAME(2,4)

Important

You can use symbolic variables and substrings in:

  • OUTCOPYDSN
  • RECOVERYDSN
  • INCOPY MODEL dataSetName
  • INCOPY MODEL dataSetName followed by TOCOPY LASTCOPY

You cannot use substrings in:

  • TOCOPY dataSetName
  • INDEP OUTSPACE MODEL dataSetName

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

Length of result 12

&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

&DSNUM, &PART 4,5

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

&DATE 4,7

Current date (in the form YYMMDD)

6 bytes

&TIME 4, 7

Current time (in the form HHMMSS)

6 bytes

&JDATE 4, 7

Current Julian date (in the form YYDDD)

5 bytes

&YEAR 4,7

Current year (in the form YY)

2 bytes

&MONTH 4,7

Current month (in the form MM)

2 bytes

&DAY 4,7

Current day (in the form DD)

2 bytes

&JDAY4,7

Current Julian day (in the form DDD)

3 bytes

&HOUR 4,7

Current hour (in the form HH)

2 bytes

&MINUTE 4,7

Current minute (in the form MM)

2 bytes

&SECOND 4,7

Current second (in the form SS)

2 bytes

&ICTYPE

Type of image copy:

  • F for FULL YES
  • I for FULL NO
  • A for FULL AUTO or CHANGELIMIT
  • D for FULL DSN1COPY

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:

  • LP for local site primary
  • LB for local site backup
  • RP for recovery site primary
  • RB for recovery site backup

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

Example
ABC.DSN1.DA.&DB.&TSIX..P&PART4

In this example, BMC AMI Recover generates the following 4-character partition number for partition 496:

ABC.DSN1.DA.DBNAME.TSNAME.P0496

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.

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

This is the group attachment name if one is used as an 

BMC AMI Recover

 parameter; otherwise, the subsystem ID is used.

The values for these variables are assigned when the output copy data set is allocated.

Longer utility IDs are truncated to eight characters.

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.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*