Viewing SQL text for current activity

You can view SQL text for any current SQL activity.

Procedure

To view the SQL text for a current activity:
  1. On the IBM DB2 Query Monitor for z/OS panel (the main menu), specify option 3, and press Enter.
  2. Specify the S or SF line command next to the SQL activity for which you want to view the SQL text, and press Enter.

    If you specified the S line command, the SQL text is displayed without any extra formatting:

    Figure 1. Display SQL Statement Text panel
    YYYY/MM/DD HH:MM:SS  ----- Display SQL Statement Text ----  Row N of N 
    Option  ===> ________________________________________________ Scroll ===> PAGE 
                                                                                   
     DB2 SSID: DB01   Plan: PLAN0001        DBRM: ADBMAIN   Coll: ADBL                  
                      Cursor:                     Section:       0                 
    ------------------------------------------------------------------------       
                                                                                   
         DECLARE C1 SENSITIVE DYNAMIC SCROLL CURSOR FOR SELECT ROWID , COL2 
         FROM QMTSTB01 . BILLION_FETCH                                      
    ***************************** Bottom of Data *********************************
    If you specified the SF line command, the formatted SQL text is displayed:
    Figure 2. Display SQL Statement Text panel
    YYYY/MM/DD HH:MM:SS   ---- Display SQL Statement Text ----   Row 1 of 4
    Option ===> ________________________________________________ Scroll ===> CSR
    
     DB2 SSID: DB01 Plan: PLAN0001    DBRM: ADBMAIN    Coll: ADBL
               Cursor: N/A                       Section: 0
    ------------------------------------------------------------------------
    
         DECLARE C1 SENSITIVE DYNAMIC SCROLL CURSOR
           FOR                                  
           SELECT ROWID, COL2                   
             FROM QMTSTB01.BILLION_FETCH
    ***************************** Bottom of Data **********************************
    Tip: On this panel, you can use the VIEW command to open an ISPF VIEW session where you can edit and save the SQL text. See Viewing SQL text.