Sample DIAGNOSE control statements

Use the sample control statements as models for developing your own DIAGNOSE control statements.

Example 1: Displaying DB2 MEPLs

The following DIAGNOSE utility control statement specifies that the DB2® MEPLs are to be displayed. You can use the output from this statement to find the service level of a specific DB2 module. The output lists each module, the most recent PTF or APAR that was applied to the module, and the date that the PTF or APAR was installed.

Important: Specify DB2 load libraries in the JOBLIB or STEPLIB of the DIAGNOSE DISPLAY MEPL job that are at the same maintenance level as the load libraries for the DB2 subsystem on which you execute the utility. Doing this ensures that the information that DIAGNOSE DISPLAY MEPL reports reflects the current state of the DB2 subsystem.
DIAGNOSE
 DISPLAY MEPL

Example 2: Forcing a dump

The following control statement forces a dump if an abend occurs with either of the following reason codes: X'00E40322' or X'00E40323'.

DIAGNOSE
 ALLDUMPS(X'00E40322',X'00E40323')

The following control statement forces a dump for any utility abend that occurs during the execution of the specified COPY job. The DIAGNOSE END option ends DIAGNOSE processing.

Start of change
DIAGNOSE
 ALLDUMPS
 COPY TABLESPACE DSNDB06.SYSDDF
DIAGNOSE END
End of change

Example 3: Performing a diagnosis of a specific type

The control statement in this example specifies that you want to perform a diagnosis of type 66. Run this job under the direction of IBM® Software Support to diagnose problems with utility parallelism.

Figure 1. Example of diagnosing type 66
//STEP3    EXEC DSNUPROC,UID='JUOSU226.REBUI',                         
//            UTPROC='',SYSTEM='SSTR'                                  
//SYSIN    DD *   
DIAGNOSE TYPE(66)                                                    
    REBUILD INDEX (IDOS0302, IDOS0304, IPOS0301)                       
            SORTDEVT SYSDA SORTNUM 3                                   
DIAGNOSE END                                                         
/*              

Example 4: Forcing a utility abend

The control statement in this example forces an abend of the specified COPY job when one instance of message DSNU400 is issued. The NODUMP option indicates that the DIAGNOSE utility is not to generate a dump in this situation.

Figure 2. Example of forcing an abend of the COPY utility
//STEP1    EXEC DSNUPROC,UID='IUJMU116.COPY1',
//         UTPROC='',
//         SYSTEM='DSN'
//SYSCOPY1  DD DSN=IUJMU116.COPY.STEP1.SYSCOPY1,DISP=(NEW,CATLG,CATLG),
//         UNIT=SYSDA,SPACE=(4000,(20,20),,,ROUND)
//SYSIN    DD *
DIAGNOSE  ABEND MESSAGE U400
                 INSTANCE 1
                 NODUMP
                    COPY TABLESPACE DSN8D10A.DSN8S10E
                      COPYDDN SYSCOPY1
DIAGNOSE END
//*

The following control statement forces an abend of the specified LOAD job when message DSNU311 is issued for the fifth time. The NODUMP option indicates that the DIAGNOSE utility is not to generate a dump in this situation.

DIAGNOSE
 ABEND MESSAGE U311 INSTANCE 5 NODUMP
LOAD DATA RESUME NO
  INTO TABLE TABLE1
   (NAME POSITION(1) CHAR(20))
DIAGNOSE END

Example 5: Suspending utility execution

The control statement in this example indicates that the specified COPYTOCOPY job is to be suspended when it encounters 51 occurrences of the trace ID X'2E6F'.
Figure 3. Example of suspending utility execution
//STEP2    EXEC DSNUPROC,UID='DH109012.C2C01',                           
//         UTPROC='',                                                    
//         SYSTEM='SSTR'                                                 
//COPY2    DD DSN=DH109012.C2C01.STEP2.COPY2,DISP=(MOD,CATLG,CATLG),     
//         UNIT=SYSDA,SPACE=(1000,(20,20),,,ROUND)                       
//COPY3    DD DSN=DH109012.C2C01.STEP2.COPY3,DISP=(MOD,CATLG,CATLG),     
//         UNIT=SYSDA,SPACE=(1000,(20,20),,,ROUND)                       
//COPY4    DD DSN=DH109012.C2C01.STEP2.COPY4,DISP=(MOD,CATLG,CATLG),     
//         UNIT=SYSDA,SPACE=(1000,(20,20),,,ROUND)                       
//SYSIN    DD *  																				 
   DIAGNOSE WAIT TRACEID X'2E6F' INSTANCE 51                             
    COPYTOCOPY TABLESPACE DBA91201.TPA91201 DSNUM 1                      
              FROMLASTFULLCOPY COPYDDN(,COPY2)                           
                               RECOVERYDDN(COPY3,COPY4)  
   DIAGNOSE END                                             
/*

Example 6: Displaying only CLONE data

The control statement indicates that the DIAGNOSE utility is to be display information for only the specified objects that are table clones, table spaces that contain clone tables, indexes on clone tables, or index spaces that contain indexes on clone tables.

DIAGNOSE DISPLAY DBET  
     DATABASE DBNI0501   
     CLONE