Unique dataset names used in Utilities

Document ID : KB000074708
Last Modified Date : 26/06/2018
Show Technical Document Details
In RC/Migrator JCL models are used to generate code for DB2 Utilities to use. DB2 Utilities utilise work datasets to do their processing. Work Dataset names must be unique within one batch execution or there will be the potential for conflicts during execution.
How can I avoid generating duplicate work dataset names for Utilities in a Migration analysis when I am migrating multiple tables on the same database or tablespace?
Db2 for z/os
There is a new automatic symbolic variable called %DTQUAL in R20 release that can be used in Rc/Migrator models.
This new automatic symbolic generates a date and time string that can be used in a data set name to create a unique name.

This new automatic symbolic variable can be used in your DSN variable like so:


This value is set using model services. The DSN mask field is used as a prefix for data set names in Utilities.

The format of %DTQUAL is: XDMSS

See this page for the details:
New Automatic Symbolic Variable

For this example the time of this test analysis is : 18/03/22 22:04 (YY/MM/DD HH:SS)
For this example read the working in conjunction with the documentation page above.

The format of the new variable is XDMSS so according to the documented rules:

X is the letter "V" when DD(the day of the month)  in the date is 20 through 29 so in this test X = "V"
When DD(the day of the month) is 20 through 29, XD is one of these in order :V0, V1, V2, V3, V4, V5, V6, V7, or V9. so in this case XD = "V2"
MSS is the analysis time in minutes and seconds, where M is the last digit of the minute value in the TIME automatic symbolic.

For this example the value of %TIME is : 2204537 (HHMMSSH)

M is the last digit of the minute value in the TIME automatic symbolic.

M = 4

SS represents the seconds.

SS = 53

Therefore XDMSS = V2453

For this example I am using the FAST UNLOAD model

FUNLD     T   FAST UNLOAD                RPI

 _  ALLOC1         %CALC(%ROWLEN+6*%NROWS/%BYTETRK*30/100+1)_______________
 _  ALLOC2         %CALC(%ROWLEN+6*%NROWS/%BYTETRK*40/100+1)_______________
 _  DATACLAS       ________________________________________________________
 _  DATADSN        %DSN..DATA______________________________________________
 _  DEVTYPE        %DISK___________________________________________________
 _  DISK           SYSDA___________________________________________________
 _  DSN            %USERID..%DSNQUAL2..%DSNQUAL3..%DTQUAL..T%TIME__________

The DSN variable above has been altered for this example to contain the %DTQUAL new automatic symbolic variable.

The resulting generated allocation statement based on the analysis date and time is below:

.ALLOC FI(SYSREC01)                                                    +
       DA('AUTHID.TAPSXMS.TID49.V2453.T2204537.DATA')                  +
       TRACKS                                                          +
       SPACE(835,1113)                                                 +
       UNIT(SYSDA)                                                     +

In this case the value of %DSNQUAL2 is a database name and %DSNQUAL3 as it is a table related utility is the 3-byte literal "TID"
followed by the object identifier for the table in 5-byte character format. The OBID of this table is 49 thus "TID49".

In this model the dataset name is built with the DSN value concatenated with the literal ".DATA" in the DATADSN symbolic variable above.

With the use of this new value the name can be differently generated each time the analysis is generated and so unique.
Additional Information: