Migrations using unload from an image copy on a dataset instead of catalog table within RC/Migrator
search cancel

Migrations using unload from an image copy on a dataset instead of catalog table within RC/Migrator

book

Article ID: 197216

calendar_today

Updated On:

Products

RC/Migrator for DB2 for z/OS

Issue/Introduction

Image copies are internal Db2 format backup datasets produced by a utility like Quick Copy or IBM Copy. This Image Copy Dataset can only be used by another Utility
like a Recovery or Unload Utility. A GDG is a Generation Data Group which is a dataset storage structure which is often used for the storage of image copies.
Multiple prior versions or generations of the dataset can be stored without any name change in the JCL.

The Data stored in an Image Copy Dataset can be used to populate another target database and this is often done to obtain production data for testing purposes
without hindering the operations of the online production database.

RC/Migrator for Db2 for z/OS  (RCM) can call Fast Unload for Db2 for z/OS (PFU) as part of the Analysis of a Migration Strategy to unload data from an image copy.
The Utility Model used for PFU must be modified to utilize an Image Copy on a normal dataset or one that is stored on a GDG.

Resolution

Model Services is a facility of RC/Migrator. Normally RC/Migrator will unload from the online catalog table when migrating data.

If there is a need to unload from an image copy instead, this can be accomplished by enabling Fast Unload instead of the standard Batch Processor unload.  
The vanilla Utility model for Fast Unload must be modified.

From the RC/Migrator main menu choose option 0 and then option 6 to enter Utility Model Services.

Find the Model to use and Update this model.

Enable the Fast Unload model by specifying "X" in the CMD field unless the SYM field already has a "Y" in order to activate this unload model.

CMD SYM UTILITY  OB DESCRIPTION               SIZE
 E   Y  FUNLD    T  FAST UNLOAD               RPI

Type "E" for edit as above at the FUNLD utility and press ENTER.

Scroll down to:
.DATA
  FASTUNLOAD
   UNLDDN          SYSREC
   LIMIT           %LIMIT
   OUTPUT-FORMAT   %OUTFORM
   INPUT-FORMAT    TABLE
   VSAM-BUFFERS    %CALC(80+%UBUF)
   #IF(%SORTNUM,¬=,0)
   SORTNUM         %SORTNUM
   SORTDEVT        %DEVTYPE
   ESTIMATED-ROWS  %NROWS
   #ENDIF
   SQL-ACCESS      EXTENSION
   TRUNCATE        %TRUNC
   #IF(%LOBCOLS,>,0)
   IO-BUFFERS      2
   #ENDIF
   %SELECT
.ENDDATA

Change INPUT-FORMAT TABLE to be INPUT-FORMAT IMAGECOPY and add another line,  INDDN SYSIMAG, so that SYSIMAG is explicitly referenced. 

Change SQL-ACCESS EXTENSION  to SQL-ACCESS NONE as it is not relevant to image copies. 

Set SHRLEVEL IGNORE  as again a SHRLEVEL is not relevant to image copies. 

.DATA
  FASTUNLOAD
   UNLDDN          SYSREC
   LIMIT           %LIMIT
   OUTPUT-FORMAT   %OUTFORM
   INPUT-FORMAT    IMAGECOPY
INDDN           SYSIMAG
   VSAM-BUFFERS    %CALC(80+%UBUF)
   #IF(%SORTNUM,¬=,0)
   SORTNUM         %SORTNUM
   SORTDEVT        %DEVTYPE
   ESTIMATED-ROWS  %NROWS
   #ENDIF
 SQL-ACCESS      NONE
SHRLEVEL        IGNORE
   TRUNCATE        %TRUNC
   #IF(%LOBCOLS,>,0)
   IO-BUFFERS      2
   #ENDIF
   %SELECT
.ENDDATA

Add one additional line and specify LAST-COPY YES if the most recent image copy is to be used during the unload process.
Alternatively a specific image copy can be used by using the ".ALLOC" statement.

If GDG datasets are used for image copies, an ".ALLOC" statement will have to be coded including the image copy dataset name and the generation.
The image copy dataset can be coded using symbolics.

Here is a model skeleton to use a GDG as input:

.ALLOC FI(SYSIMAG)   +
DA('%CREATOR..%DBNAME..%TSNAME..CPY(0)')      +
                  OLD

This will obtain the most recent generation dataset on the GDG to use during the unload process. 

For example, this is some generated code after the analysis where DB1 is the database and TS1 is the tablespace selected for this strategy.

.ALLOC FI(SYSIMAG)                                                     +
DA('authid.DB1.TS1.CPY(0)')                                   +
                  OLD

Consider this GDG structure of the source image copy:

authid.DB1.TS1.CPY  <------------------this is the GDG base. 
authid.DB1.TS1.CPY.G0001V00
authid.DB1.TS1.CPY.G0002V00
authid.DB1.TS1.CPY.G0003V00
authid.DB1.TS1.CPY.G0004V00

The code above %CREATOR..%DBNAME..%TSNAME..CPY(0) causes a message like this to be seen in the unload job output:

 authid.DB1.TS1.CPY.G0004V00           RETAINED,  DDNAME=SYSIMAG

The (0) obtains the most recent GDG generation dataset to be used for the unload.