Customize dynamic image copy dataset names within a Quick Copy execution?

Document ID : KB000054587
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

How can I customize dynamic image copy dataset names with SYSTEM Symbolics and substrings when running Quick Copy?

Solution:

SYSTEM Symbolics configured in the PARMLIB(PQC) member are the specifications for your image copy files that are dynamically allocated if you do not specify any SYSCPnyy DD statements. In braces after the system symbolic, users may substring a part of it for the dataset name.

The IBM System Symbolics can be substringed like this "(3:2)" where the first value is the column position and the second is the length of string from the column position to extract.

Sample symbolic values to be used in this example:

%USER = userid
%DBNAME : DB2DB
%TSNAME : DB2TS
%DSNUM : 0 because it's not partitioned.
&HHMMSS(3:2) : 00 because the job ran at 23.00.42 and it takes the third and fourth char of the time
&YYMMDD(3:2) : 10 because the job ran on 06/10/17 (ie. 17th Oct 2006).
&LHHMMSS(1:4) : 2300 because the job ran at 23.00.42 and it takes the first four chars of the time
&LHHMMSS(1:2) : 23 because the job ran at 23.00.42 and it takes the first two chars of the time

Note: The "L" in front of LHHMMSS means "Local time" as opposed to GMT.
These IBM system symbolics can be found in the IBM MVS Initialization and Tuning reference manual.

Note that IBM system symbolics start with a "&" and PQC Model symbolics start with a "%". The PQC Model symbolics can be found in the PQC User Guide.

Here are some examples of the format in the PQC member and the result based on the above symbolic values.
The first line is the format in the PQC PARMLIB member. The next line is the result string used to allocate the image copy dataset dynamically.
The other allocation details have been omitted for this discussion.

LB DSN=%USER..%DBNAME..%TSNAME..LB#%DSNUM..T&HHMMSS(3:2)
userid.DB2DB.DB2TS.LB#000.T00

LP DSN=%USER..%DBNAME..%TSNAME..LP#%DSNUM..D&YYMMDD(3:2)
userid.DB2DB.DB2TS.LP#000.D10

LP2 DSN=%USER..%DBNAME..%TSNAME..LP2#%DSNUM..T&LHHMMSS(1:4)
userid.DB2DB.DB2TS.LP2#000.T2300

RB DSN=%USER..%DBNAME..%TSNAME..RB#%DSNUM..D%DATE
userid.DB2DB.DB2TS.RB#000.D061017

RB2 DSN=%USER..%DBNAME..%TSNAME..RB2#%DSNUM..T%TIME
userid.DB2DB.DB2TS.RB2#000.T2300426

RP DSN=%USER..%DBNAME..%TSNAME..RP#%DSNUM..T&LHHMMSS(1:2)
userid.DB2DB.DB2TS.RP#000.T23

When the name is customized the user should be mindful to produce a valid dataset name from the format. An invalid one will not be identified utill the PQC job is executed and it will fail to allocate the dataset at that time.