Locating the Problem

Team-Fly    

 
DB2 Universal Database for OS/390 v7.1 Application Certification Guide
By Susan Lawson
Table of Contents
Chapter 9.  Testing and Debugging Applications

Locating the Problem

If your program does not run correctly, you need to isolate the problem. If the DB2 did not invalidate the program's application plan, you should check the following items:

  • Output from the precompiler, which consists of errors and warnings. Ensure that you have resolved all errors and warnings.

  • Output from the compiler or assembler. Ensure that you have resolved all error messages.

  • Output from the linkage editor.

    - Have you resolved all external references?

    - Have you included all necessary modules in the correct order?

    - Did you include the correct language interface module? The correct language interface module is

    • DSNELI for TSO

    • DFSLI000 for IMS

    • DSNCLI for CICS

    • DSNALI for the call attachment facility

    - Did you specify the correct entry point to your program?

  • Output from the bind process.

    - Have you resolved all error messages?

    - Did you specify a plan name ?

    • If not, the bind process assumes you want to process the DBRM for diagnostic purposes, but do not want to produce an application plan.

    • Have you specified all the DBRMs and packages associated with the programs that make up the application and their partitioned dataset (PDS) names in a single application plan?

  • Your JCL.

    - If you are using IMS, have you included the DL/I option statement in the correct format?

    - Have you included the region size parameter in the EXEC statement? Does it specify a region size large enough for the storage required for the DB2 interface, the TSO, IMS, or CICS system, and your program?

    - Have you included the names of all datasets (DB2 and non-DB2) that the program requires?

  • Your program.

    - You can also use dumps to help localize problems in your program. For example, one of the more common error situations occurs when your program is running and you receive a message that it abended. In this instance, your test procedure might be to capture a TSO dump. To do so, you must allocate a SYSUDUMP or SYSABEND dump dataset before calling DB2. When you press the Enter key (after the error message and READY message), the system requests a dump. You then need to FREE the dump dataset.

Analyzing Precompiler Error and Warning Messages

Under some circumstances, the statements that the DB2 precompiler generates can produce compiler or assembly error messages. You must know why the messages occur when you compile DB2-produced source statements. For more information about warning messages, refer to the individual host language.

SYSTERM Output from the Precompiler

The DB2 precompiler provides SYSTERM output when you allocate the DD name SYSTERM. If you use the Program Preparation panels to prepare and run your program, DB2I allocates SYSTERM according to the TERM option you specify.

The SYSTERM output provides a brief summary of the results from the precompiler, all error messages that the precompiler generated, and the statement in error, when possible. Sometimes, the error messages by themselves are not enough. In such cases, you can use the line number provided in each error message to locate the failing source statement. The following code shows the format of SYSTERM output. Note the superscript numbers 1 through 7 in the code, which correspond to the notes following the example.

 DB2 SQL PRECOMPILER MESSAGES  DSNH104I E DSNHPARS LINE 32 COL 26 ILLEGAL SYMBOL "X"VALID SYMBOLS ARE:,FROM  1  SELECT VALUE INTO HIPPO X;  2  DB2 SQL PRECOMPILER STATISTICS SOURCE STATISTICS  3  SOURCE LINES READ:36 NUMBER OF SYMBOLS:15 SYMBOL TABLE BYTES EXCLUDING ATTRIBUTES:1848 THERE WERE 1 MESSAGES FOR THIS PROGRAM.  4  THERE WERE 0 MESSAGES SUPPRESSED BY THE FLAG OPTION.  5  111664 BYTES OF STORAGE WERE USED BY THE PRECOMPILER.  6  RETURN CODE IS 8  7  
Code Notes
  1. Error message.

  2. Source SQL statement.

  3. Summary statements of source statistics.

  4. Summary statement of the number of errors detected .

  5. Summary statement indicating the number of errors detected but not printed. That value might occur if you specify a FLAG option other than I.

  6. Storage requirement statement telling you how many bytes of working storage that the DB2 precompiler actually used to process your source statements. That value helps you determine the storage allocation requirements for your program.

  7. Return code: 0 = success; 4 = warning; 8 = error; 12 = severe error; 16 = unrecoverable error.

SYSPRINT Output from the Precompiler

SYSPRINT output is what the DB2 precompiler provides when you use a procedure to precompile your program. When you use the Program Preparation panels to prepare and run your program, DB2 allocates SYSPRINT according to TERM option you specify (on line 12 of the Program Preparation: Compile, Prelink, Link, and Run panel). As an alternative, when you use the DSNH command procedure (CLIST), you can specify PRINT(TERM) to obtain SYSPRINT output at your terminal, or you can specify PRINT(qualifier) to place the SYSPRINT output into a dataset named authorizationid.qualifier.PCLIST . Assuming that you do not specify PRINT as LEAVE, NONE, or TERM, DB2 issues a message when the precompiler finishes, telling you where to find your precompiler listings. This helps you locate your diagnostics quickly and easily.

The SYSPRINT output can provide information about your precompiled source module if you specify the options SOURCE and XREF when you start the DB2 precompiler. The format of SYSPRINT output is as follows :

  • A list of the DB2 precompiler options (see following code example and notes) in effect during the precompilation (if you did not specify NOOPTIONS).

     DB2 SQL PRECOMPILER             Version 7  OPTIONS SPECIFIED:HOST(PLI),XREF,SOURCE  1  OPTIONS USED -SPECIFIED OR DEFAULTED  2  APOST APOSTSQL CONNECT(2) DEC(15) FLAG(I) NOGRAPHIC HOST(PLI) NOT KATAKANA LINECOUNT(60) MARGINS(2,72) ONEPASS OPTIONS PERIOD SOURCE STDSQL(NO) SQL(DB2)         XREF 
Code Notes
  1. This section lists the options specified at precompilation time. This list does not appear if one of the precompiler option is NOOPTIONS.

  2. This section lists the options that are in effect, including defaults, forced values, and options you specified. The DB2 precompiler overrides or ignores any options you specify that are inappropriate for the host language.

  • A listing (see the following code example and notes) of your source statements (only if you specified the SOURCE option).

     DB2 SQL PRECOMPILER TMN5P40:PROCEDURE OPTIONS (MAIN):PAGE 2  1 TMN5P40:PROCEDURE OPTIONS(MAIN);00000100 2 /*******************************************************00000200 3 *program description and prologue 00000300 ... 1324 /*************************************************/00132400 1325 /*GET INFORMATION ABOUT THE PROJECT FROM THE */00132500 1326 /*PROJECT TABLE.*/00132600 1327 /*************************************************/00132700 1328 EXEC SQL SELECT ACTNO,PREQPROJ,PREQACT 00132800 1329 INTO PROJ_DATA 00132900 1330 FROM TPREREQ 00133000 1331 WHERE PROJNO =:PROJ_NO;00133100 1332 00133200 1333 /*************************************************/00133300 1334 /*PROJECT IS FINISHED.DELETE IT.*/00133400 1335 /*************************************************/00133500 1336 00133600 1337 EXEC SQL DELETE FROM PROJ 00133700 1338 WHERE PROJNO =:PROJ_NO;00133800 ... 1523 END;00152300 DB2 SQL PRECOMPILER SYMBOL CROSS-REFERENCE LISTING PAGE 29 DATA NAMES DEFN REFERENCE "ACTNO"****FIELD 1328 "PREQACT"****FIELD 1328 "PREQPROJ"****FIELD 1328 "PROJNO"****FIELD 1331 1338 ... PROJ_DATA 495 CHARACTER(35) 1329 PROJ_NO 496 CHARACTER(3) 1331 1338 "TPREREQ"****TABLE 1330 1337 
Code Notes
  1. The left column of sequence numbers, which the DB2 precompiler generates, is for use with the symbol cross-reference listing, the precompiler error messages, and the BIND error messages.

  2. The right column of sequence numbers come from the sequence numbers supplied with your source statements.

  • A list of the symbolic names used in SQL statements (this listing appears only if you specify the XREF option):

    - DATA NAMES identifies the symbolic names used in source statements. Names enclosed in quotation marks (") or single quotation marks (') are names of SQL entities such as tables, columns , and authorization IDs. Other names are host variables .

    - DEFN is the number of the line that the precompiler generates to define the name. **** means that the object was not defined or the precompiler did not recognize the declarations.

    - REFERENCE contains two kinds of information: what the source program defines the symbolic name to be, and which lines refer to the symbolic name. If the symbolic name refers to a valid host variable, the list also identifies the data type or STRUCTURE.

  • A summary of the errors detected by the DB2 precompiler and a list of the error messages generated by the precompiler. See the following code example and notes.

     DB2 SQL PRECOMPILER STATISTICS SOURCE STATISTICS SOURCE LINES READ:1523  1  NUMBER OF SYMBOLS:128  2  SYMBOL TABLE BYTES EXCLUDING ATTRIBUTES:6432  3  THERE WERE 1 MESSAGES FOR THIS PROGRAM.  4  THERE WERE 0 MESSAGES SUPPRESSED.  5  65536 BYTES OF STORAGE WERE USED BY THE PRECOMPILER.  6  RETURN CODE IS 8.  7  DSNH104I E LINE 590 COL 64 ILLEGAL SYMBOL:'X';VALID SYMBOLS ARE:,FROM  8  
Code Notes
  1. Summary statement indicating the number of source lines.

  2. Summary statement indicating the number of symbolic names in the symbol table (SQL names and host names).

  3. Storage requirement statement indicating the number of bytes for the symbol table.

  4. Summary statement indicating the number of messages printed.

  5. Summary statement indicating the number of errors detected but not printed. You might get this statement if you specify the option FLAG.

  6. Storage requirement statement indicating the number of bytes of working storage actually used by the DB2 precompiler to process your source statements.

  7. Return code: 0 = success; 4 = warning; 8 = error; 12 = severe error; and 16 = unrecoverable error.

  8. Error messages (this example detects only one error).


Team-Fly    
Top


DB2 Universal Database for OS. 390 v7. 1 Application Certification Guide
DB2(R) Universal Database for OS/390 V7.1 Application Certification Guide (IBM DB2 Certification Guide Series)
ISBN: 0131007718
EAN: 2147483647
Year: 2002
Pages: 163
Authors: Susan Lawson

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net