Grouping SQLCODE information

You can group SQLCODE information to help you locate problematic SQL activity.

Procedure

To group SQLCODE information:
  1. On the IBM DB2 Query Monitor for z/OS panel (the main menu)), specify option 2, and press Enter.
  2. On the DB2 QM SQL Code Summary panel, type the appropriate command in the Group By field to refine the display of information to suit your needs.
    Figure 1. DB2 QM SQL Code Summary panel
    YYYY/MM/DD HH:MM:SS  ------ DB2 QM SQL Code Summary -----  Row 1 of 2          
    Option  ===>                                                  Scroll ===> CSR  
     QM Subsystem : QM01         Interval Start Date: MM/DD/YYYY  Time: HH:MM:SS 
                                   Interval End   Date: CURRENT     Time: CURRENT  
    Group by  S    (P-Plan, D-DBRM/Package, A-Authid, S-SQLCode, I-CorrID,                  
                    N-CorrName)  Specify "*" for no grouping                                     
    C: S-Select detail, P-Plans, D-DBRMs/Packages, A-AUTHIDs, I-CorrID, N-CorrName  
    ------------------------------------------------------------------------       
    CMD SQL Code     Occurrences                                                   
     -  --------  --------------                                                   
     _  -104                   3                                                   
     _  -204                   5                                                   
    ***************************** Bottom of Data **********************************
     

    For example, to group by Db2® authorization ID, type A in the Group By field and press Enter. The SQLCODE information is grouped by authorization ID:

    Figure 2. DB2 QM SQL Code Summary panel
    YYYY/MM/DD HH:MM:SS  ------ DB2 QM SQL Code Summary -----  Row 1 of 2          
    Option  ===>                                                  Scroll ===> CSR  
     QM Subsystem : QM01         Interval Start Date: MM/DD/YYYY  Time: HH:MM:SS 
                                   Interval End   Date: CURRENT     Time: CURRENT  
    Group by  A_   (P-Plan, D-DBRM/Package, A-Authid, S-SQLCode, I-CorrID,
                    N-CorrName)  Specify "*" for no grouping                   
    C: P-Plans, D-DBRMs/packages, S-SQLCODEs, I-CorrID, N-CorrName                                      
    ------------------------------------------------------------------------       
    CMD Authid      Occurrences                                                    
     -  -------- --------------                                                    
     _  USERID1               5                                                    
     _  USERID2               3                                                    
    ***************************** Bottom of Data **********************************
  3. Issue line commands to drill down into a row.
    For example, you can issue the P line command and press Enter to view plans associated with an item.
    Figure 3. DB2 QM SQL Code Group Summary panel
    YYYY/MM/DD HH:MM:SS  --- DB2 QM SQL Code Group Summary ---  Row 1 of 1         
    Option  ===>                                                  Scroll ===> PAGE 
     QM Subsystem : QM01         Interval Start Date: MM/DD/YYYY  Time: HH:MM:SS 
                                   Interval End   Date: CURRENT     Time: CURRENT  
     Plan level SQLCODE summary for :                                              
       Primary Authid:  PDUSERA                                                    
    C: D-DBRMs/Packages, I-CorrID, N-CorrName, S-SQLCODEs                                                
    ------------------------------------------------------------------------       
    CMD  Plan     Occurrences                                                      
     --  -------- --------------                                                   
     __  PLAN01                5                                                   
    ***************************** Bottom of Data **********************************

    To view the SQLCODEs associated with an item, issue the S line command, and press Enter.

    Figure 4. DB2 QM SQL Code Group Summary panel
    YYYY/MM/DD HH:MM:SS  --- DB2 QM SQL Code Group Summary ---  Row 1 of 2         
    Option  ===>                                                  Scroll ===> CSR 
     QM Subsystem : QM01         Interval Start Date: MM/DD/YYYY  Time: HH:MM:SS 
                                      Interval End   Date: CURRENT     Time: CURRENT  
     SQLCODE data captured for:                                                    
       Primary Authid:  PDUSERA                                                    
       Plan Name:       DSNESPRR                                                   
                                                                                   
                                                                                   
     C:S - Select Detail                                                           
    ------------------------------------------------------------------------       
    CMD  SQLCODE   Occurrences                                                     
     --  --------- --------------                                                  
     __  -552                   3                                                  
     __  -551                   2                                                  
    ***************************** Bottom of Data **********************************

    You can now view SQLCODE details by issuing the S line command.