HP 3000 Manuals

Using RPG DEBUG [ HP RPG/XL Programmer's Guide ] MPE/iX 5.0 Documentation


HP RPG/XL Programmer's Guide

Using RPG DEBUG 

RPG has a facility, DEBUG, that you can use in your program as a
debugging tool.  DEBUG is an operation used with Calculation
Specifications.  It lets you monitor the status of indicators and the
contents of fields, tables and arrays while a program is executing.  You
place DEBUG statements before and after the operations that you want to
monitor.

DEBUG information is usually displayed on your terminal (session mode) or
printed along with your job listing (job mode).  If you wish, you can
have this information written to a disc file instead.

Figure 7-2 shows how to use DEBUG. To enable DEBUG, you must enter a 1 in
column 15 of the Header Specification.  If you leave this column blank,
DEBUG statements in your program are ignored (treated as comments).

	       Click here to view figure.
          Figure 7-2.  Using DEBUG 

            Comments 

 1       This Header Specification enables the DEBUG feature of RPG.

         Column 15 is 1 to enable DEBUG.

 2       This line defines the disc file that holds the DEBUG
         information.

 3       This line logs DEBUG information to a disc file.

         Columns 18-27 contain a tag, M-1EXMPT, that identifies this
         DEBUG operation data in the disc file.

         Columns 28-32 specifies the DEBUG operation.

         Columns 33-42 name the disc file, DEBUGFL, in which the DEBUG
         data is saved.

         Columns 43-48 specify that the contents of the field, PTR1, are
         also written to the disc file.

 4       This line logs DEBUG information to a disc file.

         Columns 18-27 contain a tag, M-1END, that identifies this DEBUG
         operation data in the disc file.



MPE/iX 5.0 Documentation