Generating a Db2® utility job

To generate a Db2® utility job:

  1. Specify the Db2® utility you want to generate:
    1
    COPY
    2
    LOAD
    3
    REBUILD
    4
    RECOVER
    5
    REORG
    6
    RUNSTATS
    7
    UNLOAD
  2. Specify the object type:
    1
    Tables
    2
    Table spaces
    3
    Index spaces
    4
    Indexes
    5
    Indexes for table spaces
  3. For COPY, REBUILD, RECOVER, REORG, RUNSTATS, and UNLOAD (that is, all the FM/Db2 Db2® utilities except LOAD), you can specify that a LIST clause is to be included in the JCL generated by FM/Db2 for the nominated Db2® utility.

    To generate a LIST clause in the JCL for the Db2® utility, select 2. LISTDEF; otherwise, select 1. Object name.

  4. You now need to supply details about either the object or the LISTDEF for the Db2® utility job:
    • If you specified 1. Object name in the Specification section (Step 3), optionally, specify details about the object by using one or more of the four filter fields:
      • Database
      • Table/Index space
      • Owner (Table or Index)
      • Name (Table or Index)
      FM/Db2 validates any details you enter and carries them forward to the next panel.
      For each of the preceding filter fields, you can enter:
      • The full name of the item.
      • An asterisk (*) to display a list of items from which you can select the one you want.

        If you enter an asterisk (*) in any of the four filter fields, FM/Db2 displays the respective selection list panel from which you can select a value to put into the filter field. The records displayed in these panels are restricted by any other related filter you have previously entered. Each combination of utility and Db2® object results in certain valid filter combinations. Incorrect filter combinations are rejected.

      • A pattern to display a list of all items whose name matches the pattern specification.
      • Blanks. No filtering effect occurs.
    • If you specified 2. LISTDEF in the Specification section (Step 3), enter the name to be used in the LIST clause in LISTDEF name.
  5. Press Enter.

    FM/Db2 displays the panel for the specified Db2® utility and object type.

    If you specified 1. Object name in the Specification section (Step 3), the panel shows the qualifying list of rows, with various input and output fields. Select the rows you want and change the values in any of the editable fields as required.

    If you specified 2. LISTDEF in the Specification section (Step 3), FM/Db2 displays an alternative panel for the Db2® utility. See Working with LISTDEF utility panels.

  6. Press Enter.
    FM/Db2 displays the generated JCL which you can edit if you need to before you submit it as a job. (The LOAD and UNLOAD utilities are exceptions to this rule, as both utilities show another series of panels, before displaying the generated JCL.) Sample JCL generated for COPY Utility (table spaces) shows an example of generated JCL.
    Figure 1. Sample JCL generated for COPY Utility (table spaces)
       File  Edit  Edit_Settings  Menu  Utilities  Compilers  Test  Help
    ────────────────────────────────────────────────────────────────────────────────
     EDIT       FMNUSER.SPFTEMP1.CNTL                           Columns 00001 00072
     ****** ***************************** Top of Data ******************************
     000001 //FMNUSERB JOB (IBMGSA),
     000002 //             FMNUSER,MSGCLASS=A,
     000003 //             NOTIFY=FMNUSER,CLASS=A,
     000004 //             MSGLEVEL=(1,1)
     000005 //*
     000006 //         JCLLIB ORDER=(DB2V810.DFA2.PROCLIB)
     000007 //*
     000008 //**********************************************************************
     000009 //* STEP COPY1: COPY TABLESPACE DSN8D81A.DSN8S81D
     000010 //**********************************************************************
     000011 //COPY1    EXEC DSNUPROC,SYSTEM=DFA2,UID='FMNUSER'
     000012 //DSNUPROC.STEPLIB  DD DSN=DB2V810.DFA2.SDSNEXIT,DISP=SHR
     000013 //         DD DSN=DB2.V810.SDSNLOAD,DISP=SHR
     000014 //DSNUPROC.SYSCOPY  DD DISP=(NEW,CATLG,DELETE),
     000015 //         DSN=FMNUSER.DSN8D81A.DSN8S81D.F00000.D2601115,
     000016 //         UNIT=SYSALLDA,SPACE=(TRK,(1,1),RLSE)
     000017 //DSNUPROC.SYSIN    DD *
     000018 COPY TABLESPACE DSN8D81A.DSN8S81D
     000019   COPYDDN(SYSCOPY)
     000020 /*
     ****** **************************** Bottom of Data ****************************
    
     Command ===>                                                  Scroll ===> PAGE
      F1=Help      F2=Split     F3=Exit      F5=Rfind     F6=Rchange   F7=Up
      F8=Down      F9=Swap     F10=Left     F11=Right    F12=Cancel
  7. To submit the JCL as a job stream for batch processing, use the SUBMIT command.

The following sections describe each of the Db2® utilities that FM/Db2 supports.

Related tasks