Queries can be analyzed outside of QMF using the Query Analyzer edit macro named RAAQA. While you are in an ISPF EDIT session, you can select a query from the edited data set and invoke Query Analyzer.
You can enter the name of the DB2 subsystem in which to analyze the query after the macro name. For example, to analyze a query in DB2 subsystem DB2T, type RAAQA DB2T on the command line.
Here is an example of how to invoke query analysis from an ISPF EDIT session.
EDIT ---- USERAPPL.SOURCE(QUERY1) -- 01.00 ------------------- COLUMNS 007 072 Command ===> RAAQA DB2T Scroll ===> CSR 013700 DEPT SMALLINT , 013800 JOB CHARACTER(5) , 013900 YEARS SMALLINT , 014000 SALARY DECIMAL(7,2) , 014100 COMM DECIMAL(7,2) 014200 ) 014300 END-EXEC. 014400 * 014500 EXEC SQL 014600 DECLARE C1 CURSOR FOR 014700 QQ SELECT ID, NAME 014900 FROM Q.STAFF QQ WHERE COMM IS NOT NULL 015100 015200 END-EXEC. 015300 * 015400 EXEC SQL INCLUDE SQLCA END-EXEC. 015500 * 015600 01 SAVED-SQLCODE PIC S9(9) COMP. 015700 * |
If you type RAAQA or RAAQA ssid on the command line and press Enter, the selected query will be analyzed in the specified DB2 subsystem. If you do not specify a subsystem, the last subsystem specified will be used. If any errors are detected, the panel will be redisplayed with an error message. Otherwise, the analysis data will be passed to the exit routine.
The fields on the panel are: