Rational Developer for System z
PL/I for Windows, Version 8.0, Programming Guide

Using compile-time options for debugging

The PL/I workstation products are designed to diagnose many of the bugs in your programs at compile time, and provides you with a compiler listing that explains what mistakes you made and where you made them. In addition, you can use compile-time options to make the compiler listing even more useful.

The following compile-time options are useful for debugging your PL/I programs:

FLAG
Suppresses the listing of diagnostic messages below a certain severity and terminates compilation if a specified number of messages is reached. If your program is not behaving as expected and the compiler messages do not explain the problem, you might want to use FLAG to include informational messages in the compiler listing. These messages (otherwise suppressed by default) might help explain problems in your program. For additional information on using FLAG, see FLAG.
GONUMBER
Creates a statement number table that is needed for debugging.
PREFIX
Enables or disables specified PL/I conditions. Because you can specify the conditions with a compile-time option, you do not need to change your source program. Compiling with PREFIX( SUBRG STRZ STRG) can be very helpful in debugging. For more information on using PREFIX, see PREFIX.
RULES
Specifies the strictness with which various language rules are enforced by the compiler. You can use it to flag common programming errors.

You might find the following suboptions for RULES particularly useful for debugging:

NOLAXIF
Disallows IF, WHILE, UNTIL, and WHEN clauses to evaluate to other than BIT(1) NONVARYING.
NOLAXDCL
Disallows all implicit and contextual declarations except for built-ins and the files SYSIN and SYSPRINT.
NOLAXQUAL
The compiler flags any reference to structure members that are not level 1 and are not dot qualified.

For example, consider the program:

  program: proc( ax1xcb, ak2xcb );
           dcl (ax1xcb, ax2xcb ) pointer;
           dcl
             1 xcb based,
             2 xcba13 fixed bin,...
           ak1xcb->xcba13 = ax2xcb->xcba13;
  

With RULES(NOLAXDCL) in effect, the two typographical errors above are considered implicit declarations by the compiler and are flagged as errors. For more information on using RULES, see RULES.

SNAP
Specifies that the compiler produces a listing of trace information that is useful for locating errors in your program.

For detailed information on using SNAP for debugging, see SNAP dumps for trace information.

For more information on SNAP syntax, see SNAP.

XREF
Specifies that the compiler listing includes a table of names used in the program together with the numbers of the statements in which they are referenced or set. This allows you to easily track where names are used in your source program. For more information on using XREF, see XREF.

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)