Debugging the Application

CA IDMS provides these tools that you can use to debug the SQL portion of the application program:
idms19
CA IDMS provides these tools that you can use to debug the SQL portion of the application program:
Command Facility
The Command Facility is a tool for a user to issue ad hoc SQL statements in an interactive online environment or in batch mode.
You can use this facility to test SQL statement syntax and to test conditions of the database both when you are designing the application and, if necessary, while debugging.
You can use CA OLQ to access CA IDMS with SQL. For more information, see "Online Query Reference."
This example shows a query submitted online to the Command Facility and the result table returned. A successful SELECT statement, such as the one shown here, can be declared as a cursor with no change to the syntax.
OCF nn.n ONLINE IDMS NO ERRORS 1/16 SELECT PROJ_ID, EST_START_DATE, PROJ_DESC FROM DEMOPROJ.PROJECT WHERE EST_START_DATE > CURRENT DATE ORDER BY 2; *+ *+ PROJ_ID EST_START_DATE PROJ_DESC *+ ------- -------------- --------- *+ C203 1998-02-01 Consumer study *+ C240 1998-06-01 Service study *+ C200 1999-01-15 New brand research *+ D880 1999-11-01 Systems Analysis *+ P634 2000-02-01 TV ads - WTVK *+ P200 2000-09-01 Christmas media *+ *+ 6 rows processed
SQL Trace Facility
You can use the SQL trace facility to trace execution of the SQL statements in a batch program.
You activate the SQL trace facility by specifying the SYSIDMS parameter SQLTRACE=ON.
In this example, the SQL trace facility reports on the SQL processing for a SELECT statement submitted through IDMSBCF, the batch Command Facility. The trace facility shows the steps in dynamically executing the SELECT, including an automatic CONNECT.
SELECT R.REFTABLE AS "PARENT", K.REFCOLUMN AS "PARENT COLUMN", R.NAME AS "RELATIONSHIP" FROM SYSTEM.CONSTRAINT R, SYSTEM.CONSTKEY K WHERE R.SCHEMA = K.SCHEMA AND R.NAME = K.NAME AND R.SCHEMA = 'REL' AND R.TABLE = 'C_EMPLOYEE' AND R.UNIQUE >= ' ' OR R.COMPRESS <= ' ' ; Verb=07 CONNECT TO SYSSQL Caller=IDMSBCF SQLSEQ=000001 *** S Q L Verb=20 PREPARE-─► SELECT R.REFTABLE AS "PARENT", Caller=IDMSBCF SQLSEQ=000008 *** S Q L Verb=11 DESCRIBE Caller=IDMSBCF SQLSEQ=000005 *** S Q L Verb=19 OPEN Caller=IDMSBCF SQLSEQ=000007 *** S Q L Verb=16 FETCH Caller=IDMSBCF SQLSEQ=000006 *** S Q L S Q L SQLCODE=0100 REASON CODE=0000 Verb=03 CLOSE Caller=IDMSBCF SQLSEQ=000002 *** S Q L PARENT PARENT COLUMN RELATIONSHIP C_DEPARTMENT C_DEPT_ID DEPT_EMPLOYEE C_PROJECT C_PROJ_ID EMP_PROJECT 2 rows processed Verb=05 COMMIT continue Caller=IDMSBCF SQLSEQ=000003 *** S Q L . . .
You can activate and deactivate the SQL trace facility within the logic of the program. You do this by issuing calls to the IDMSIN01 entry point to the IDMS module.
You can activate and deactivate the DML or SQL trace for a single CICS transaction, using the SYSIDMS parameter IDMSIN01_ONLY.
For more information on the requirements for calling IDMSIN01 to activate or deactivate the SQL trace facility, see "IDMSIN01."
EXPLAIN Statemen
You can use the EXPLAIN statement to analyze the optimized access strategy for an SQL statement. An aspect of database definition or the formulation of the SQL statement can result in a relatively inefficient strategy for a given SQL statement. The information produced by the EXPLAIN statement can suggest corrective measures.
Online Debugger
You can debug online application program execution using the CA IDMS online debugger. The online debugger allows you to:
  • Set breakpoints in the program
  • Stop execution of the program at a breakpoint
  • Examine and optionally alter conditions that exist at the breakpoint
  • Resume program execution
For more information on debugging online application programs, see "Administrating Online Debugger."