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

Using the compiler listing

During compilation, the compiler generates listings that contain information about the source program, the compilation, and the object module. The TERMINAL option sends diagnostics and statistics to your terminal. The IBM.PRINT environment variable specifies the output directory for printable listing files (see IBM.PRINT for more information on the IBM.PRINT environment variable). The following description of the listing refers to its appearance on a printed page.

This listing for CHIMES program highlights some of the more useful parts of the compiler listing. Figure 3 is similar to the compiler listing for that program.

Figure 3. CHIMES program compiler listing
5724-B67  IBM(R) PL/I for Windows   8.0      (Built:20110706)                                  2011.07.22 06:00:59   Page     1


                    Options Specified   1 

 Environment: 
 
 Command:  op

 Line.File Process Statements

    1.0    *PROCESS MACRO S A(F) X AG;
    2.0    *PROCESS NOT('^') OR('|');


                    Options Used   2 

      ADDEXT
 +    AGGREGATE(DECIMAL)
 +    ATTRIBUTES(FULL)
      BIFPREC(31)
      BLANK('09'x)
      CHECK( NOCONFORMANCE NOSTORAGE )
      CMPAT(LE)
      CODEPAGE(00819)
    NOCOMPILE(S)
    NOCOPYRIGHT
      CURRENCY('$')
    NODBCS
      DEFAULT(IBM ASSIGNABLE NOINITFILL NONCONNECTED LOWERINC
              DESCRIPTOR DESCLIST DUMMY(ALIGNED) ORDINAL(MIN)
              BYADDR RETURNS(BYVALUE) LINKAGE(OPTLINK) NORETCODE
              NOINLINE REORDER NOOVERLAP NONRECURSIVE ALIGNED NULLSYS
              BIN1ARG PSEUDODUMMY NULLSTRADDR NULLSTRPTR(NULL) EVENDEC
              SHORT(HEXADEC) ASCII IEEE NATIVE NATIVEADDR E(IEEE))
      DEPRECATE(
                 BUILTIN()
                 ENTRY()
                 INCLUDE()
                 VARIABLE()
               )
    NODLLINIT
    NOEXIT
      EXTRN(SHORT)
      FLAG(W)
      FLOATINMATH(ASIS)
    NOGONUMBER
    NOGRAPHIC
    NOIGNORE
      IMPRECISE
      INCAFTER(PROCESS(""))
    NOINCDIR
      INCLUDE(EXT('inc' 'cpy' 'mac'))
    NOINITAUTO
    NOINITBASED
    NOINITCTL
    NOINITSTATIC
    NOINSOURCE
      LANGLVL(NOEXT)
      LIBS( SINGLE DYNAMIC )
5724-B67  IBM(R) PL/I for Windows                                                              2011.07.22 06:00:59   Page     2

      LIMITS( EXTNAME(100) FIXEDBIN(31,31) FIXEDDEC(15,15) NAME(100) )
      LINECOUNT(60)
    NOLINEDIR
    NOLIST
      LISTVIEW(SOURCE)
 +    MACRO
      MARGINI(' ')
      MARGINS(2,72)
      MAXGEN(100000)
      MAXMSG(W 250)
      MAXNEST( BLOCK(17) DO(17) IF(17) )
      MAXSTMT(4096)
      MAXTEMP(50000)
    NOMDECK
      MSG(*)
      NAMES('@#$' '@#$')
      NATLANG(ENU)
    NONEST
      NOT('^')
      NUMBER
      OBJECT
    NOOFFSET
    NOONSNAP
      OPTIMIZE(0)
 +    OPTIONS(DOC)
      OR('|')
 +    PP( MACRO )
    NOPPCICS
    NOPPINCLUDE
      PPLIST(KEEP)
    NOPPMACRO
    NOPPSQL
    NOPPTRACE
      PRECTYPE(ANS)
      PREFIX(CONVERSION FIXEDOVERFLOW INVALIDOP OVERFLOW
             NOSIZE NOSTRINGRANGE NOSTRINGSIZE NOSUBSCRIPTRANGE
             UNDERFLOW ZERODIVIDE)
      PROBE
    NOPROCEED(S)
      PROCESS(DELETE)
      QUOTE('"')
      REDUCE
      RESEXP
      RESPECT()
      RULES(IBM BYNAME NODECSIZE ELSEIF EVENDEC GOTO GLOBALDO NOLAXBIF
            NOLAXCTL LAXDCL NOLAXDEF LAXENTRY LAXIF LAXINOUT LAXLINK
            LAXMARGINS LAXPUNC LAXQUAL LAXRETURN LAXSCALE LAXSEMI LAXSTG
            NOLAXSTRZ MULTICLOSE PADDING PROCENDONLY SELFASSIGN STOP UNREF)
    NOSEMANTIC(S)
    NOSNAP
    NOSOSI
 +    SOURCE
      STATIC(SHORT)
    NOSTMT
    NOSTORAGE
    NOSYNTAX(S)
      SYSPARM('')
      SYSTEM(WINDOWS)
	  
5724-B67  IBM(R) PL/I for Windows                                                              2011.07.22 06:00:59   Page     3

      TERMINAL
    NOTEST
      USAGE( HEX(SIZE) ROUND(IBM) SUBSTR(STRICT) UNSPEC(IBM) )
      WIDECHAR(LITTLEENDIAN)
      WINDOW(1950)
      XINFO(NODEF NOXML)
      XML( CASE(UPPER) )
 +    XREF(FULL)
5724-B67  IBM(R) PL/I for Windows                                                              2011.07.22 06:00:59   Page     4

Compiler Source

   Line.File

      3.0
      4.0      /********************************************************************/
      5.0      /*                                                                  */
      6.0      /*  NAME - CHIMES.PLI                                               */
      7.0      /*                                                                  */
      8.0      /*  DESCRIPTION                                                     */
      9.0      /*    Plays a tune using system API services                        */
     10.0      /*                                                                  */
     11.0      /*    5639-A83, 5639-A24 (C) Copyright IBM Corp. 1992,2011.         */
     12.0      /*    All Rights Reserved.                                          */
     13.0      /*    US Government Users Restricted Rights-- Use, duplication or   */
     14.0      /*    disclosure restricted by GSA ADP Schedule Contract with       */
     15.0      /*    IBM Corp.                                                     */
     16.0      /*                                                                  */
     17.0      /*  DISCLAIMER OF WARRANTIES                                        */
     18.0      /*    The following 'enclosed' code is sample code created by IBM   */
     19.0      /*    Corporation. This sample code is not part of any standard     */
     20.0      /*    IBM product and is provided to you solely for the purpose of  */
     21.0      /*    assisting you in the development of your applications.  The   */
     22.0      /*    code is provided "AS IS", without warranty of any kind.       */
     23.0      /*    IBM shall not be liable for any damages arising out of your   */
     24.0      /*    use of the sample code, even if IBM has been advised of the   */
     25.0      /*    possibility of such damages.                                  */
     26.0      /*                                                                  */
     27.0      /********************************************************************/
     28.0
     29.0      CHIMES: PROC OPTIONS(MAIN);      /* Play a tune using DOSBEEP tones */
     30.0
     31.0         DCL ( REST  VALUE(   0 ),            /* Declare Named Constants  */
     32.0               G4    VALUE( 392 ),            /* for note and rest tone   */
     33.0               C5    VALUE( 523 ),            /* values and timings.      */
     34.0               D5    VALUE( 587 ),
     35.0               E5    VALUE( 657 ),
     36.0               WHOLE VALUE( 800 ) ) FIXED BIN(31);
     37.0
     38.0         DCL NOTES(19,2) STATIC NONASGN FIXED BIN(31)
     39.0             INIT( E5, (WHOLE/2),              /* Declare tone and timing */
     40.0                   C5, (WHOLE/2),              /* for each note of tune.  */
     41.0                   D5, (WHOLE/2),
     42.0                   G4, (WHOLE),                /* Initial values may be   */
     43.0                 REST, (WHOLE/2),              /* restricted expressions  */
     44.0                   G4, (WHOLE/2),              /* using Named Constants   */
     45.0                   D5, (WHOLE/2),              /* previously defined in   */
     46.0                   E5, (WHOLE/2),              /* this program.           */
     47.0                   C5, (WHOLE),
     48.0                 REST, (WHOLE/2),
     49.0                   E5, (WHOLE/2),
     50.0                   C5, (WHOLE/2),
     51.0                   D5, (WHOLE/2),
     52.0                   G4, (WHOLE),
     53.0                 REST, (WHOLE/2),
     54.0                   G4, (WHOLE/2),
     55.0                   D5, (WHOLE/2),
     56.0                   E5, (WHOLE/2),
5724-B67  IBM(R) PL/I for Windows                                                              2011.07.22 06:00:59   Page     5

   Line.File

     57.0                   C5, (WHOLE) );
     58.0
     59.0         DCL I FIXED BIN(31);
     60.0
     61.0         /* Declare external APIs called by chimes. */
     62.0
     64.0         DCL BEEP     ENTRY( FIXED BIN(31), FIXED BIN(31) ) /* tone, time */
     65.0                      EXT( 'Beep' )          /* External name of function */
     66.0                      OPTIONS( BYVALUE       /* Pass parameters by value  */
     67.0                               LINKAGE(STDCALL));
     68.0
     69.0
     70.0         DCL SLEEP    ENTRY( FIXED BIN(31) )        /* Time duration only */
     71.0                      EXT( 'Sleep' )
     72.0                      OPTIONS( BYVALUE
     73.0                               LINKAGE(STDCALL) );
     88.0
     89.0         /* Play all of the notes and rests of the tune using a do loop.  */
     90.0
     91.0         DO I = LBOUND(NOTES,1) TO HBOUND(NOTES,1);
     92.0           IF NOTES(I,1) ^= 0        /* Note the use of ?for logical NOT */
     93.0           THEN CALL BEEP( NOTES(I,1), NOTES(I,2) );
     94.0           ELSE CALL SLEEP( NOTES(I,2) );
     95.0         END;
     96.0
     97.0      END;	 

5724-B67  IBM(R) PL/I for Windows                                                              2011.07.22 06:00:59   Page     6


                   Attribute/Xref Table    4 

    Line.File Identifier                      Attributes

      64.0    BEEP                            CONSTANT EXTERNAL('Beep')
                                              ENTRY( BYVALUE FIXED BIN(31,0),
                                                     BYVALUE FIXED BIN(31,0) )
                                              OPTIONS( LINKAGE ( STDCALL ) )
                                              Refs: 93.0
      33.0    C5                              CONSTANT FIXED BIN(31,0)
                                              Refs: 38.0 38.0 38.0 38.0
      29.0    CHIMES                          CONSTANT EXTERNAL
                                              ENTRY()
                                              OPTIONS( LINKAGE ( OPTLINK ) )
      34.0    D5                              CONSTANT FIXED BIN(31,0)
                                              Refs: 38.0 38.0 38.0 38.0
      35.0    E5                              CONSTANT FIXED BIN(31,0)
                                              Refs: 38.0 38.0 38.0 38.0
      32.0    G4                              CONSTANT FIXED BIN(31,0)
                                              Refs: 38.0 38.0 38.0 38.0
     +++++++  HBOUND                          BUILTIN
                                              Refs: 91.0
      59.0    I                               AUTOMATIC FIXED BIN(31,0)
                                              Refs: 92.0 93.0 93.0 94.0
                                              Sets: 91.0
     +++++++  LBOUND                          BUILTIN
                                              Refs: 91.0
      38.0    NOTES                           STATIC NONASSIGNABLE DIM(1:19,1:2) FIXED BIN(31,0) INITIAL
                                              Refs: 91.0 91.0 92.0 93.0 93.0 94.0
      31.0    REST                            CONSTANT FIXED BIN(31,0)
                                              Refs: 38.0 38.0 38.0
      70.0    SLEEP                           CONSTANT EXTERNAL('Sleep')
                                              ENTRY( BYVALUE FIXED BIN(31,0) )
                                              OPTIONS( LINKAGE ( STDCALL ) )
                                              Refs: 94.0
      36.0    WHOLE                           CONSTANT FIXED BIN(31,0)
                                              Refs: 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0
                                                    38.0 38.0 38.0 38.0
5724-B67  IBM(R) PL/I for Windows                                                              2011.07.22 06:00:59   Page     7


                   Aggregate Length Table    5 

    Line.File Dims     Offset   Total Size    Base Size  Identifier


      38.0     2            0          152            4  NOTES
	  

5724-B67  IBM(R) PL/I for Windows                                                              2011.07.22 06:00:59   Page     8


No Compiler Messages

File Reference Table    6 

  File    Included From  Name

     0                   C:\pliz\newfe\chimes.pli
     3 

Component    Return Code    Messages (Total/Suppressed)    Time     7 

MACRO            0                0  /  0                   0 secs
Compiler         0                0  /  0                   0 secs

End of compilation of CHIMES
 1  Options specified
This section of the compiler listing shows any compile-time options you specified. Options shown under Install: are specified in your IBM.OPTIONS environment variable. Options shown under Command: indicate that these options were specified on the command line when you invoked the compiler (there are no command options in this example). Options specified with the *PROCESS or %PROCESS statement are shown below the command options.
 2  Options used
The compiler listing includes a list of all compile-time options used, including the default options. If an option is marked with a plus sign (+), the default has been changed. If any compile-time options contradict each other, the compiler uses the one with the highest priority. The following list shows which options the compiler uses, beginning with the highest priority:
 3  Using the NUMBER option
The statement numbers shown are generated by the NUMBER option. In this case, the statement begins on the 14th line in file 1. The File Reference Table at the bottom of the listing also shows that file 1 refers to D:\ibmpli\samples\chimes.pli.

By generating these statement numbers during compilation, you can locate lines that need editing (indicated in messages, for example) without having to refer to the listing.

 4  Attribute and cross-reference table
If you specify the ATTRIBUTES option, the compiler provides an attribute table containing a list of the identifiers in the source program together with their declared and default attributes in the compiler listing. The FULL attribute lists all identifiers and attributes. If you specify the SHORT suboption for ATTRIBUTES, unreferenced identifiers are not listed.

If you specify the XREF option, the compiler prints a cross-reference table containing a list of the identifiers in the source program together with the Line.File number (the statement number inside the file and the file number, respectively) in which they appear in the compiler listing.

An identifier appears in the Sets: part of the cross-reference table if it is:

If there are unreferenced identifiers, they are displayed in a separate table (not shown in this example).

If you specify ATTRIBUTES and XREF (as in this example), the two tables are combined.

Explicitly-declared variables are listed with the number of the DECLARE statement in which they appear. Implicitly-declared variables are indicated by asterisks and contextually declared variables (HBOUND and LBOUND in this example) are indicated by plus (+) signs. (Undeclared variables are also listed in a diagnostic message.)

The attributes INTERNAL and REAL are never included; they can be assumed unless the respective conflicting attributes, EXTERNAL and COMPLEX, are listed.

For a file identifier, the attribute FILE always appears, and the attribute EXTERNAL appears if it applies; otherwise, only explicitly declared attributes are listed.

For an array, the dimension attribute is printed first. If the bound of an array is a restricted expression, the value of that expression is shown for the bound; otherwise an asterisk is shown.

If the length of a bit string or character string is a restricted expression, that value is shown, otherwise an asterisk is shown.

 5  Aggregate length table
If you specified the AGGREGATE option, the compiler provides an aggregate length table in the compiler listing. The table shows how each aggregate in the program is mapped. Table 5 shows the headings for the aggregate length table columns and the description of each.
Table 5. Aggregate length table headings and description
Heading Description
Line.File The statement number and file number in which the aggregate is declared
Offset The byte offset of each element from the beginning of the aggregate
Total Size The total size in bytes of the aggregate
Base Size The size in bytes of the data type
Identifier The name of the aggregate and the element within the aggregate
 6  File reference table
The Included From column of the File reference table indicates where the corresponding file from the Name column was included. The first entry in this column is blank because the first file listed is the source file. Entries in the Included From column show the line number of the include statement followed by a period and the file number of the source file containing the include.
 7  Component, return code, diagnostic messages, time
The last part of the compiler listing consists of the following headings:
Component
Shows you which component or processor is providing the information. Either the macro facility, if invoked, or the compiler itself can provide you with informational messages.
Return code
Shows you the highest return code generated by the component, issued upon completion of compilation. Possible return codes are:
0 (Informational)
No warning messages detected (as in this example). The compiled program should run correctly. The compiler might inform you of a possible inefficiency in your code or some other condition of interest.
4 (Warning)
Indicates that the compiler found minor errors, but the compiler could correct them. The compiled program should run correctly, but might produce different results than expected or be significantly inefficient.
8 (Error)
Indicates that the compiler found significant errors, but the compiler could correct them. The compiled program should run correctly, but might produce different results than expected.
12 (Severe error)
Indicates that the compiler found errors that it could not correct. If the program was compiled and an object module produced, it should not be used.
16 (Unrecoverable error)
Indicates an error-forced termination of the compilation. An object module was not successfully created.
Note:
When coding CMD files for PL/I, you can use the return code to decide whether or not post-compilation procedures are performed.
Messages
Indicates:
  • The number of messages issued, if any
  • The number of messages suppressed, if any, because they were equal to or below the severity level set by the FLAG compile-time option.
Messages for the compiler, macro facility, SQL preprocessor, and run-time environment are listed and explained in Messages and Codes.

Only messages of the severity above that specified by the FLAG option are issued. The messages, statements, and return code appear on your screen unless you specify the NOTERMINAL compile-time option.

Time
Shows you the total time the component took to process your program.
Rational Developer for System z
PL/I for Windows, Version 8.0, Programming Guide