Reorganizing a database and using PSSR to sort the unloaded data set

You can include a PSSR job step in your reorganization job to sort the unloaded data set during reorganization process.

Before you begin

Several considerations apply for using the output of PSSR as an input of IMS™ High Performance Load for z/OS® Version 2 Release 1 or later. For details, see Considerations before using PSSR.

Procedure

To use PSSR, you must run several programs. These programs can be run in either a single job or in several jobs. A typical PSSR job stream contains some or all of the following steps:

Recommendation: Always include steps 1 and 13 in the PSSR job that actually performs a database reorganization. Use of any of the other steps depends on the logical relationships involved.
Note: For information about using IMS utilities, see IMS Database Utilities.

  1. Run the IMS Database Image Copy utility (DFSUDMP0) to create a copy of each of the old databases before reorganization.

    These image copies are the backup copies of your databases. These backup copies can be used if something goes wrong in the reorganization process.

  2. Run the IMS Database Prereorganization utility (DFSURPR0) to create a control data set (DFSURCDS).

    This control data set is used by the other IMS logical relationship resolution utilities. The DFSURPR0 utility also indicates which databases and segments (if any) need to be scanned by the IMS Database Scan utility.

  3. Run the IMS Database Scan utility (DFSURGS0) to scan any databases not being loaded or reorganized for segments that contain logical relationships that are affected by loading or reorganizing other databases.

    For each segment of this type, the utility generates one or more output records, depending upon the relationships in which that segment is involved. It generates an output work data set that will be used by the IMS Database Prefix Resolution utility.

  4. Run the IMS HD Reorganization Unload utility (DFSURGU0) or its equivalent program such as unload utilities of IMS High Performance Unload to create a sequential data set that contains the old unloaded databases.
  5. Run the DBDGEN procedure.

    This IMS procedure creates the DBDs for the new reorganized databases. You must assemble and link-edit the new DBDs.

  6. Run the PSSR utility.

    When PSSR is run in either an IMS environment or a non IMS environment, it sorts the unloaded database data set in physical sequence.

    Note: The only difference between a standard database reorganization job and a database reorganization job that is done by PSSR is the addition of this step.

    Running a PSSR job includes the following tasks:

    1. Select the IBM® supplied cataloged procedure to use, or prepare a similar procedure of your own.

      There are two ways to run PSSR, and the following two catalog procedures are provided:

      FABSPSSR
      Use the FABSPSSR procedure if you want to run the PSSR job as a standard (non IMS) MVS™ batch job.
      FABSPSSI
      Use the FABSPSSI procedure if you want to run the PSSR job as a batch job using the IMS environment.
      For the contents of these cataloged procedures, see FABSPSSR and FABSPSSI JCL procedures.
    2. Code the JCL for the PSSR step.
    3. Code the input data for the PSSR programs.
    4. Run the PSSR job.
    5. Interpret the output reports to verify that the process completed successfully.
  7. Run the IDCAMS program to delete the old database data sets and allocate the new database data sets.
  8. Run the IMS HD Reorganization Reload utility (DFSURGL0) or an equivalent program such as IMS HP Load to reload a database from the sequential data set that is created by the IMS HD Reorganization Unload utility or its equivalent utility.

    This step also creates work data sets that are used as input to the logical relationship resolution utilities.

  9. Run the IMS Database Prefix Resolution utility (DFSURG10) to accumulate the information that is generated in work data sets (DFSURCDS and DFSURWF1).

    It produces an output data set (DFSURWF3) that contains the prefix information that is needed to complete the logical relationships defined for the databases. It also produces an output data set (DFSURIDX) that contains the information that is needed to create secondary index databases.

  10. Run the IMS HISAM Reorganization Unload utility (DFSURUL0) to format the index work data set (DFSURIDX) to a form that can be used by the IMS HISAM Reorganization Reload utility.
  11. Run the IMS HISAM Reorganization Reload utility (DFSURRL0) to create the secondary index databases from the reorganized output data sets provided by the IMS HISAM Reorganization Unload utility.
  12. Run the IMS Database Prefix Update utility (DFSURGP0) to update the prefix of each segment of which prefix information is affected by the reload process.

    The utility uses the output (DFSURWF3) from the IMS Database Prefix Resolution utility to update the prefix of each segment.

  13. Run the IMS Database Image Copy utility (DFSUDMP0) to create a copy of each of the new databases.

    These copies are the first backup copies of the new databases.

FABSPSSR and FABSPSSI JCL procedures

The following two figures show the contents of the FABSPSSR JCL procedure and the FABSPSSI JCL procedure.

Figure 1. FABSPSSR JCL procedure
//        PROC CYL=1,                                                   00010000
//             DBDLIB=’IMSVS.DBDLIB’,            <<--------<            00020000
//             DBTLIB=’HPS.SHPSLMD0’,                                   00030000
//             RNDLIB=’IMSVS.RESLIB’,            <<--------<            00040000
//             SRTLIB=’SYS1.SORTLIB’,                                   00050000
//             UNIT=SYSDA,                                              00060000
//             SVOL=XXXXXX,                      <<--------<            00070000
//             SUNT=SYSDA,                                              00080000
//             IMSHDUN=’UNLOAD.FILE’                                    00090000
//*-------------------------------------------------------------------- 00100000
//*  IMS HIGH PERFORMANCE LOAD VERSION 2 (5655-M26)                     00110000
//*  PHYSICAL SEQUENCE SORT FOR RELOAD                                  00120000
//*-------------------------------------------------------------------- 00130000
//STEPHD  EXEC PGM=SORT,REGION=2048K                                    00140000
//STEPLIB   DD DSNAME=&SRTLIB,DISP=SHR                                  00150000
//IMS       DD DSNAME=&DBDLIB,DISP=SHR                  DBD LOAD MODULE 00160000
//IMS2      DD DSNAME=&RNDLIB,DISP=SHR         HDAM RANDOMIZING ROUTINE 00170000
//          DD DSNAME=&DBTLIB,DISP=SHR           HPS PSSR EXIT ROUTINES 00180000
//SORTIN    DD DSNAME=&IMSHDUN,DISP=(OLD,PASS) INPUT UNLOADED DATA BASE 00190000
//SORTOUT   DD DSNAME=&&UNLSRT,               OUTPUT UNLOADED DATA BASE 00200000
//             DISP=(NEW,PASS,DELETE),                      PART 1 OF 2 00210000
//             SPACE=(CYL,(&CYL)),                                      00220000
//             UNIT=&SUNT,VOLUME=SER=&SVOL                              00230000
//SORTOUT2  DD DSNAME=&&UNLSRT2,              OUTPUT UNLOADED DATA BASE 00240000
//             DISP=(NEW,PASS,DELETE),                      PART 2 OF 2 00250000
//             SPACE=(CYL,(&CYL)),                                      00260000
//             UNIT=&SUNT,VOLUME=SER=&SVOL,DCB=&IMSHDUN                 00270000
//SYSOUT    DD SYSOUT=*                                   SORT MESSAGES 00280000
//PR8       DD SYSOUT=*                                FABSRT15 REPORTS 00290000
//PR9       DD SYSOUT=*                                 FABSRT35 REPORT 00300000
//PR9X      DD SYSOUT=*                                 FABSRT35 REPORT 00310000
//SYSUDUMP  DD SYSOUT=*                                                 00320000
//SORTWK01  DD UNIT=&UNIT,SPACE=(CYL,(&CYL))        WORKFILE FOR DFSORT 00330000
//SORTWK02  DD UNIT=&UNIT,SPACE=(CYL,(&CYL))        WORKFILE FOR DFSORT 00340000
//SORTWK03  DD UNIT=&UNIT,SPACE=(CYL,(&CYL))        WORKFILE FOR DFSORT 00350000
//SORTWK04  DD UNIT=&UNIT,SPACE=(CYL,(&CYL))        WORKFILE FOR DFSORT 00360000
//SORTWK05  DD UNIT=&UNIT,SPACE=(CYL,(&CYL))        WORKFILE FOR DFSORT 00370000
//SORTWK06  DD UNIT=&UNIT,SPACE=(CYL,(&CYL))        WORKFILE FOR DFSORT 00380000
//HDHEADER  DD DSN=&&HEADER,                      WORKFILE FOR HPS PSSR 00390000
//             DISP=(NEW,PASS,DELETE),                                  00400000
//             UNIT=SYSDA,SPACE=(TRK,(1)),DCB=BLKSIZE=60                00410000
//*-------------------------------------------------------------------- 00420000
//*  THIS PROC REQUIRES THE USER TO SUPPLY 2 ADDITIONAL DD STATEMENTS:  00430000
//*     SYSIN ... CONTAINS 3 OR 4 DFSORT CONTROL STATEMENTS             00440000
//*     CTL ..... CONTAINS 1 HPS CONTROL STATEMENT                      00450000
//*-------------------------------------------------------------------- 00460000
Figure 2. FABSPSSI JCL procedure
//FABSPSSI PROC CYL=1,                                                  00010000
//             DBDLIB=’IMSVS.DBDLIB’,                                   00020000
//             DBTLIB=’HPS.SHPSLMD0’,                                   00030000
//             RESLIB=’IMSVS.RESLIB’,                                   00040000
//             RNDLIB=’IMSVS.RESLIB’,                                   00050000
//             SRTLIB=’SYS1.SORTLIB’,                                   00060000
//             UNIT=SYSDA,                                              00070000
//             SVOL=XXXXXX,                                             00080000
//             SUNT=3390,                                               00090000
//             IMSHDUN=’UNLOAD.FILE’                                    00100000
//*-------------------------------------------------------------------- 00110000
//*  IMS HIGH PERFORMANCE LOAD VERSION 2 (5655-M26)                     00110000
//*  PHYSICAL SEQUENCE SORT FOR RELOAD                                  00130000
//*-------------------------------------------------------------------- 00140000
//STEPHD  EXEC PGM=FABSMAIN,REGION=4096K                                00150000
//STEPLIB   DD DSNAME=&SRTLIB,DISP=SHR                                  00160000
//          DD DSNAME=&RESLIB,DISP=SHR                                  00170000
//          DD DSNAME=&DBTLIB,DISP=SHR                                  00180000
//IMS       DD DSNAME=&DBDLIB,DISP=SHR                  DBD LOAD MODULE 00190000
//IMS2      DD DSNAME=&RNDLIB,DISP=SHR                                  00200000
//DFSRESLB  DD DSNAME=&RESLIB,DISP=SHR                                  00220000
//SORTIN    DD DSNAME=&IMSHDUN,DISP=(OLD,PASS) INPUT UNLOADED DATA BASE 00230000
//SORTOUT   DD DSNAME=&&UNLSRT,               OUTPUT UNLOADED DATA BASE 00240000
//             DISP=(NEW,PASS,DELETE),                      PART 1 OF 2 00250000
//             SPACE=(CYL,(&CYL)),                                      00260000
//             UNIT=&SUNT,VOLUME=SER=&SVOL                              00270000
//SORTOUT2  DD DSNAME=&&UNLSRT2,              OUTPUT UNLOADED DATA BASE 00280000
//             DISP=(NEW,PASS,DELETE),                      PART 2 OF 2 00290000
//             SPACE=(CYL,(&CYL)),                                      00300000
//             UNIT=&SUNT,VOLUME=SER=&SVOL,                             00310000
//             DCB=&IMSHDUN                                             00320000
//SYSOUT    DD SYSOUT=A                                   SORT MESSAGES 00330000
//PR8       DD SYSOUT=A                                FABSRT15 REPORTS 00340000
//PR9       DD SYSOUT=A                                 FABSRT35 REPORT 00350000
//PR9X      DD SYSOUT=A                                 FABSRT35 REPORT 00360000
//PR10      DD SYSOUT=A                                 FABSRT35 REPORT 00370000
//SYSPRINT  DD SYSOUT=A                                    IMS MESSAGES 00380000
//SYSUDUMP  DD SYSOUT=A                                                 00390000
//SORTWK01  DD UNIT=&UNIT,SPACE=(CYL,(&CYL))        WORKFILE FOR DFSORT 00400000
//SORTWK02  DD UNIT=&UNIT,SPACE=(CYL,(&CYL))        WORKFILE FOR DFSORT 00410000
//SORTWK03  DD UNIT=&UNIT,SPACE=(CYL,(&CYL))        WORKFILE FOR DFSORT 00420000
//SORTWK04  DD UNIT=&UNIT,SPACE=(CYL,(&CYL))        WORKFILE FOR DFSORT 00430000
//SORTWK05  DD UNIT=&UNIT,SPACE=(CYL,(&CYL))        WORKFILE FOR DFSORT 00440000
//SORTWK06  DD UNIT=&UNIT,SPACE=(CYL,(&CYL))        WORKFILE FOR DFSORT 00450000
//HDHEADER  DD DSN=&&HEADER,                      WORKFILE FOR HPS PSSR 00460000
//             DISP=(NEW,PASS,DELETE),                                  00470000
//             UNIT=SYSDA,SPACE=(TRK,(1)),DCB=BLKSIZE=60                00480000
//*-------------------------------------------------------------------- 00490000
//*  THIS PROC REQUIRES THE USER TO SUPPLY 1 ADDITIONAL DD STATEMENT:   00500000
//*     CTL... ..... CONTAINS AT LEAST 1 HPS CONTROL STATEMENT          00510000
//*-------------------------------------------------------------------- 00520000