CA RC/Migrator for DB2 for Z/OS : Migrations Using Unload From an Image Copy on a dataset Instead of catalog Table

book

Article ID: 197216

calendar_today

Updated On:

Products

CA RC/Migrator for DB2 for z/OS

Issue/Introduction

Image copies are internal DB2 format backup datasets produced by a utility like CA 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 can call CA 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 utilise an Image Copy on a normal dataset or one that is stored on a GDG. 

Environment

DB2 for Z/OS

Resolution

Model Services is a facility of CA RC/Migrator. Normally CA 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 CA Fast Unload instead of the standard Batch Processor unload.  The vanilla Utility model for CA Fast Unload must be modified.

From CA 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('%CCREATOR..%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 DBCORP is the database and TSROLE is the tablespace selected for this strategy.

.ALLOC FI(SYSIMAG)                                                     +
  DA('authid.DBCORP.TSROLE.CPY(0)')                                   +
                  OLD

Consider this GDG structure of the source image copy:

authid.DBCORP.TSROLE.CPY  <------------------this is the GDG base. 
authid.DBCORP.TSROLE.CPY.G0001V00
authid.DBCORP.TSROLE.CPY.G0002V00
authid.DBCORP.TSROLE.CPY.G0003V00
authid.DBCORP.TSROLE.CPY.G0004V00

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

 authid.DBCORP.TSROLE.CPY.G0004V00           RETAINED,  DDNAME=SYSIMAG

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