Debugging Application Programs Many sites have guidelines regarding what to do if your program abends. The following suggestions are some common ones. Debugging Programs in TSODocumenting the errors returned from testing helps you investigate and correct problems in the program. The following information can be useful:
When your program encounters an error that does not result in an abend, it can pass all the required error information to a standard error routine. Online programs might also send an error message to the terminal. Language Test FacilitiesFor information on the compiler or assembler test facilities, see the publications for the compiler or CODE/370. The compiler publications include information on the appropriate debugger for the language you are using. The TSO TEST CommandThe TSO TEST command is especially useful for debugging assembler programs. The following example is a command procedure (CLIST) that runs a DB2 application named MYPROG under TSO TEST, and sets an address stop at the entry to the program. The DB2 subsystem name in this example is DB4. PROC 0 TEST ' prefix. SDSNLOAD(DSN)'CP DSN SYSTEM(DB4) AT MYPROG.MYPROG.+0 DEFER GO RUN PROGRAM(MYPROG)LIBRARY('L186331.RUNLIB.LOAD(MYPROG)') ISPF Dialog Test is another option to help you in the task of debugging. Debugging Programs in IMSDocumenting the errors returned from testing helps you investigate and correct problems in the program. The following information can be useful:
When your program encounters an error, it can pass all the required error information to a standard error routine. Online programs can also send an error message to the originating logical terminal. An interactive program also can send a message to the master terminal operator, giving information about the program's termination. To do that, the program places the logical terminal name of the master terminal in an express PCB and issues one or more ISRT calls. Some sites run a BMP at the end of the day to list all the errors that occurred during the day. If your location does this, you can send a message using an express PCB that has its destination set for that BMP. Batch Terminal Simulator (BTS)The Batch Terminal Simulator (BTS) allows you to test IMS application programs. BTS traces application program DL/I calls and SQL statements, and simulates data communication functions. It can make a TSO terminal appear as an IMS terminal to the terminal operator, allowing the end user to interact with the application as though it were online. The user can use any application program under the user's control to access any database (whether DL/I or DB2) under the user 's control. Access to DB2 databases requires BTS to operate in batch BMP or TSO BMP mode. Debugging Programs in CICSDocumenting the errors returned from testing helps you investigate and correct problems in the program. The following information can be useful:
Using CICS facilities, you can have a printed error record; you can also print the SQLCA (and SQLDA) contents. Debugging Aids for CICSCICS provides the following aids to the testing, monitoring, and debugging of application programs:
You can use the SYNCPOINT command to subdivide a program so that you only need to resubmit the uncompleted part of a transaction. CICS Execution Diagnostic FacilityThe CICS EDF traces SQL statements in an interactive debugging mode, enabling application programmers to test and debug programs online without changing the program or the program preparation procedure. EDF intercepts the running application program at various points and displays helpful information about the statement type, input and output variables , and any error conditions after the statement executes. It also displays any screens that the application program sends, making it possible to converse with the application program during testing just as a user would on a production system. EDF displays essential information before and after an SQL statement while the task is in EDF mode. This can be a significant aid in debugging CICS transaction programs containing SQL statements. The SQL information that EDF displays is helpful for debugging programs and for error analysis after an SQL error or warning. Using this facility reduces the amount of work you need to do to write special error handlers. The following code is an example of an EDF screen before it executes an SQL statement. The names of the key information fields on this panel are in boldface. The DB2 SQL information in this screen is as follows :
SQL Statements Containing Input Host VariablesThe IVAR (input host variables) section and its attendant fields only appear when the executing statement contains input host variables. The host variables section includes the variables from predicates, the values used for inserting or updating, and the text of dynamic SQL statements being prepared. The address of the input variable is AT 'nnnnnnnn' . Additional host variable information:
The following code shows an example of the first EDF screen displayed after the executing an SQL statement. The names of the key information fields on this panel are in boldface. The DB2 SQL information in this screen is as follows:
Plus signs (+) on the left of the screen indicate that you can see additional EDF output by using PF keys to scroll the screen forward or back. The OVAR (output host variables) section and its attendant fields only appear when the executing statement returns output host variables. TRANSACTION:XC05 PROGRAM:TESTC05 TASK NUMBER:0000698 DISPLAY:00 STATUS:COMMAND EXECUTION COMPLETE CALL TO RESOURCE MANAGER DSNCSQL EXEC SQL FETCH P.AUTH =SYSADM , S.AUTH = PLAN =TESTC05, DBRM =TESTC05, STMT =00346, SECT =00001 SQL COMMUNICATION AREA: SQLCABC =136 AT X'03C92789' SQLCODE =000 AT X'03C9278D' SQLERRML =000 AT X'03C92791' SQLERRMC ='' AT X'03C92793' SQLERRP ='DSN' AT X'03C927D9' SQLERRD(1-6) =000,000,00000,-1,00000,000 AT X'03C927E1' SQLWARN(0-A) ='___________' AT X'03C927F9' SQLSTATE =00000 AT X'03C92804' +OVAR 001:TYPE=INTEGER, LEN=00004,IND=000 AT X'03C920A0' DATA=X'00000001' OFFSET:X'001D14' LINE:UNKNOWN EIBFN=X'1802' ENTER:CONTINUE PF1 :UNDEFINED PF2 :UNDEFINED PF3 :END EDF SESSION PF4 :SUPPRESS DISPLAYS PF5 :WORKING STORAGE PF6 :USER DISPLAY PF7 :SCROLL BACK PF8 :SCROLL FORWARD PF9 :STOP CONDITIONS PF10:PREVIOUS DISPLAY PF11:UNDEFINED PF12:ABEND USER TASK The attachment facility automatically displays SQL information while in the EDF mode. The following code is the remaining output from the example. TRANSACTION:XC05 PROGRAM:TESTC05 TASK NUMBER:0000698 DISPLAY:00 STATUS:COMMAND EXECUTION COMPLETE CALL TO RESOURCE MANAGER DSNCSQL +OVAR 002: TYPE=CHAR, LEN=00008,IND=000 AT X'03C920B0' DATA=X'C8F3E3E3C1C2D3C5' OVAR 003:TYPE=CHAR, LEN=00040,IND=000 AT X'03C920B8' DATA=X'C9D5C9E3C9C1D340D3D6C1C440404040404040404040404040404040'... OFFSET:X'001D14'LINE:UNKNOWN EIBFN=X'1802' ENTER:CONTINUE PF1 :UNDEFINED PF2 :UNDEFINED PF3 :END EDF SESSION PF4 :SUPPRESS DISPLAYS PF5 :WORKING STORAGE PF6 :USER DISPLAY PF7 :SCROLL BACK PF8 :SCROLL FORWARD PF9 :STOP CONDITIONS PF10:PREVIOUS DISPLAY PF11:UNDEFINED PF12:ABEND USER TASK |
Team-Fly |
Top |