Source Section

The source section shows records that comprise the ILE RPG source specifications. The root source member records are always shown. If OPTION(*EXPDDS) is also specified, then the source section shows records generated from externally described files, and marks them with a '=' in the column beside the line number. These records are not shown if *NOEXPDDS is specified. If OPTION(*SHOWCPY) is specified, then it also shows the records from /COPY members specified in the source, and marks them with a '+' in the column beside the line number. These records are not shown if *NOSHOWCPY is specified.

The source section also shows the conditional compilation process. All lines with /IF, /ELSEIF, /ELSE and /ENDIF directives and source lines selected by the /IF groups are printed and given a listing line number. If OPTION(*SHOWSKP) is specified, it shows all statements that have been excluded by the /IF, /ELSEIF, and /ELSE directives, and marks them with a '-------' in the column beside the statement. Line numbers in the listing are not incremented for excluded lines. All skipped statements are printed exactly as specified, but are not interpreted in any way. For example, an excluded statement with an /EJECT directive does not cause a page break. Similarly, /SPACE, /TITLE, /COPY and /EOF compiler directives are ignored if they are encountered in excluded lines. These statements are not shown if the default OPTION(*NOSHOWSKP) is specified; instead a message is printed giving the number of lines excluded.

The source section identifies any syntax errors in the source, and includes a match-field table, when appropriate.

If OPTION(*NOSRCSTMT) is specified, line numbers are printed sequentially on the left side of the listing to reflect the compiled source line numbers. Source IDs and SEU sequence numbers are printed on the right side of the listing to identify the source members and records respectively. For example, Figure 241 shows a section of the listing with a /COPY statement in line 35. In the root source member, the next line is a DOWEQ operation. In the listing, however, the DOWEQ operation is on line 39. The three intervening lines shown in the listing are from the /COPY source member.

Figure 241. Sample Section of the Listing with OPTION(*NOSRCSTMT)
Line   <--------------------- Source Specifications ----------------------------------------------><---- Comments ----> Src Seq
Number ....1....+....2....+<-------- 26 - 35 -------->....4....+....5....+....6....+....7....+....8....+....9....+...10 Id  Number
    34 C                   MOVE                       '123'         BI_FLD1                                                 001500
    35 C/COPY MYCPY                                                                                              971104     001600
        *--------------------------------------------------------------------------------------------*
        * RPG member name  . . . . . :  MYCPY                                                        *                     5
        * External name  . . . . . . :  RPGGUIDE/QRPGLESRC(MYCPY)                                    *                     5
        * Last change  . . . . . . . :  98/07/24  16:20:04                                           *                     5
        * Text 'description' . . . . :  Text on copy member                                          *                     5
        *--------------------------------------------------------------------------------------------*
    36+C     Blue(1)       DSPLY                                                                                           5000100
    37+C     Green(4)      DSPLY                                                                                           5000200
    38+C     Red(2)        DSPLY                                                                                           5000300
    39 C     *in20         doweq                      *OFF                                                                  001700

If OPTION(*SRCSTMT) is specified, sequence numbers are printed on the left side of the listing to reflect the SEU sequence numbers. Statement numbers are printed on the right side of the listing. The statement number information is identical to the source ID and SEU sequence number information. For example, Figure 242 shows a section of the listing that has a /COPY statement with sequence number 001600. The next line in the root source member is the same as the line with the next sequence number in the listing: sequence number 001700. The three intervening lines are assigned the SEU sequence numbers from the /COPY source member. The corresponding statement numbers are genereated from source IDs and SEU sequence numbers of the root and /COPY source members.

Figure 242. Sample Section of the Listing with OPTION(*SRCSTMT)
Seq    <--------------------- Source Specifications ----------------------------------------------><---- Comments ----> Statement
Number ....1....+....2....+<-------- 26 - 35 -------->....4....+....5....+....6....+....7....+....8....+....9....+...10 Number
001500 C                   MOVE                       '123'         BI_FLD1                                                 001500
001600 C/COPY MYCPY                                                                                              971104     001600
        *--------------------------------------------------------------------------------------------*
        * RPG member name  . . . . . :  MYCPY                                                        *                     5
        * External name  . . . . . . :  RPGGUIDE/QRPGLESRC(MYCPY)                                    *                     5
        * Last change  . . . . . . . :  98/07/24  16:20:04                                           *                     5
        * Text 'description' . . . . :  Text on copy member                                          *                     5
        *--------------------------------------------------------------------------------------------*
000100+C     Blue(1)       DSPLY                                                                                           5000100
000200+C     Green(4)      DSPLY                                                                                           5000200
000300+C     Red(2)        DSPLY                                                                                           5000300
001700 C     *in20         doweq                      *OFF                                                                  001700

Figure 243 shows the entire source section for MYSRC with OPTION(*NOSRCSTMT) specified.

Figure 243. Sample Source Part of the Listing
5769WDS V5R2M0  020719 RN        IBM ILE RPG            MYLIB/MYSRC            ISERIES1   02/08/15 14:21:00      Page    2
   1a 
Line   <---------------------- Source Specifications ----------------------------><---- Comments ----> Do  Page  Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line  Date   Id  Number
                          S o u r c e   L i s t i n g
     1 H DFTACTGRP(*NO) ACTGRP('Srcactgrp') CCSID(*GRAPH:*SRC)                                                   980727     000100
     2 H OPTION(*NODEBUGIO)                                                                                      980727     000200
     3 H BNDDIR('SRCLIB1/BNDDIR1' : 'SRCLIB2/BNDDIR2' : '"ext.nam"')                                             971104     000300
     4 H ALTSEQ(*SRC)                                                                                            971104     000400
     5 H FIXNBR(*ZONED)                                                                                          980728     000500
     6 H TEXT('Text specified on the Control Specification')                                                     971104     000600
        *--------------------------------------------------------------------*   2 
        * Compiler Options in Effect:                                        *
        *--------------------------------------------------------------------*
        *  Text 'description' . . . . . . . :                                *
        *                 Text specified on the Control Specification        *
        *  Generation severity level  . . . :   10                           *
        *  Default activation group . . . . :   *NO                          *
        *  Compiler options . . . . . . . . :   *XREF      *GEN              *
        *                                       *SECLVL    *SHOWCPY          *
        *                                       *EXPDDS    *EXT              *
        *                                       *SHOWSKP *NOSRCSTMT        *
        *                                       *NODEBUGIO   *NOEVENTF       *
        *  Optimization level . . . . . . . :   *NONE                        *
        *  Source listing indentation . . . :   '| '                         *
        *  Type conversion options  . . . . :   *NONE                        *
        *  Sort sequence  . . . . . . . . . :   *HEX                         *
        *  Language identifier  . . . . . . :   *JOBRUN                      *
        *  User profile . . . . . . . . . . :   *USER                        *
        *  Authority  . . . . . . . . . . . :   *LIBCRTAUT                   *
        *  Truncate numeric . . . . . . . . :   *YES                         *
        *  Fix numeric  . . . . . . . . . . :   *ZONED      *INPUTPACKED     *
        *  Allow null values  . . . . . . . :   *NO                          *
        *  Binding directory from Command . :   BNDDIRA      BNDDIRB         *
        *    Library  . . . . . . . . . . . :     CMDLIBA      CMDLIBB       *
        *  Binding directory from Source  . :   BNDDIR1      BNDDIR2         *
        *    Library  . . . . . . . . . . . :     SRCLIB1      SRCLIB2       *
        *                                       "ext.nam"                    *
        *                                         *LIBL                      *
        *  Activation group . . . . . . . . :   Srcactgrp                    *
        *  Enable performance collection  . :   *PEP                         *
        *  Profiling data . . . . . . . . . :   *NOCOL                       *
        *--------------------------------------------------------------------*
     7 FInFile    IF   E             DISK                                                                        971104     000700
        *--------------------------------------------------------------------------------------------*   3 
        *                               RPG name         External name                               *
        * File name. . . . . . . . . :  INFILE           MYLIB/INFILE                                *
        * Record format(s) . . . . . :  INREC            INREC                                       *
        *--------------------------------------------------------------------------------------------*
     8 FKEYL6     IF   E           K DISK                                                                        971104     000800
        *--------------------------------------------------------------------------------------------*
        *                               RPG name         External name                               *
        * File name. . . . . . . . . :  KEYL6            MYLIB/KEYL6                                 *
        * Record format(s) . . . . . :  REC1             REC1                                        *
        *                               REC2             REC2                                        *
        *--------------------------------------------------------------------------------------------*
     9 FOutfile   O    E             DISK                                                                        971104     000900
        *--------------------------------------------------------------------------------------------*
        *                               RPG name         External name                               *
        * File name. . . . . . . . . :  OUTFILE          MYLIB/OUTFILE                               *
        * Record format(s) . . . . . :  OUTREC           OUTREC                                      *
        *--------------------------------------------------------------------------------------------*
    10 D Blue            S              4    DIM(5) CTDATA PERRCD(1)                                             971104     001000
    11 D Green           S              2    DIM(5) ALT(Blue)                                                    971104     001100
    12 D Red             S              4    DIM(2) CTDATA PERRCD(1)                                             980727     001200
    13 D DSEXT1        E DS           100    PREFIX(BI_) INZ(*EXTDFT)                                            980727     001300
    14 D   FLD3        E                     INZ('111')                                                          980727     001400
        *--------------------------------------------------------------------------------------------*   4                 1
        * Data structure . . . . . . :  DSEXT1                                                       *                     1
        * Prefix . . . . . . . . . . :  BI_ :    0                                                   *                     1
        * External format  . . . . . :  REC1 : MYLIB/DSEXT1                                          *                     1
        * Format text  . . . . . . . :  Record format description                                    *                     1
        *--------------------------------------------------------------------------------------------*                     1
   5 
    15=D BI_FLD1                        5A   EXTFLD (FLD1)                        FLD1 description                         1000001
    16=D                                     INZ (*BLANK)                                                                  1000002
    17=D BI_FLD2                       10A   EXTFLD (FLD2)                        FLD2 description                         1000003
    18=D                                     INZ (*BLANK)                                                                  1000004
    19=D BI_FLD3                       18A   EXTFLD (FLD3)                        FLD3 description                         1000005
    20=D                                     INZ ('111')                                                                   1000006
    21=IINREC                                                                                                              2000001
        *--------------------------------------------------------------------------------------------*                     2
        * RPG record format  . . . . :  INREC                                                        *                     2
        * External format  . . . . . :  INREC : MYLIB/INFILE                                         *                     2
        *--------------------------------------------------------------------------------------------*                     2
    22=I                             A    1   25  FLDA                                                                     2000002
    23=I                             A   26   90  FLDB                                                                     2000003
    24=I                  13488 *VAR C   91  112  UCS2FLD                                                                  2000004
    25=IREC1                                                                                                               3000001
        *--------------------------------------------------------------------------------------------*                     3
        * RPG record format  . . . . :  REC1                                                         *                     3
        * External format  . . . . . :  REC1 : MYLIB/KEYL6                                           *                     3
        *--------------------------------------------------------------------------------------------*                     3
    26=I                        *ISO-D    1   10  FLD12                                                                    3000002
    27=I                             A   11   13  FLD13                                                                    3000003
    28=I                             A   14   17  FLD14                                                                    3000004
    29=I                             A   18   22  FLD15                                                                    3000005
    30=I                  13488      C   23   32  FLDC                                                                     3000006
    31=I                  13488 *VAR C   33   44  FLDCV                                                                    3000007
    32=I                  835        G   45   54  FLDG                                                                     3000008
    33=IREC2                                                                                                               4000001
        *--------------------------------------------------------------------------------------------*                     4
        * RPG record format  . . . . :  REC2                                                         *                     4
        * External format  . . . . . :  REC2 : MYLIB/KEYL6                                           *                     4
        *--------------------------------------------------------------------------------------------*                     4
    34=I                        *ISO-D    1   10  FLD22                                                                    4000002
    35=I                             A   11   13  FLD23                                                                    4000003
    36=I                             A   14   17  FLD24                                                                    4000004
    37=I                             A   18   22  FLD25                                                                    4000005
Line   <--------------------- Source Specifications ----------------------------------------------><---- Comments ----> Src Seq
Number ....1....+....2....+<-------- 26 - 35 -------->....4....+....5....+....6....+....7....+....8....+....9....+...10 Id  Number
    38 C                   MOVE                       '123'         BI_FLD1                                                 001500
    39 C/COPY MYCPY                                                                                              971104     001600
        *--------------------------------------------------------------------------------------------*   6 
        * RPG member name  . . . . . :  MYCPY                                                        *                     5
        * External name  . . . . . . :  MYLIB/QRPGLESRC(MYCPY)                                       *                     5
        * Last change  . . . . . . . :  98/07/24  16:20:04                                           *                     5
        * Text 'description' . . . . :  Text specified on Copy Member                                *                     5
        *--------------------------------------------------------------------------------------------*
   7 
    40+C     Blue(1)       DSPLY                                                                                           5000100
    41+C     Green(4)      DSPLY                                                                                           5000200
    42+C     Red(2)        DSPLY                                                                                           5000300
   8 
    43 C     *in20         doweq                      *OFF                                                                  001700
    44 C                   | READ                     InRec                              ----20                             001800
    45 C                   | if                       NOT *in20                                                             001900
    46 C     FLDA          | | DSPLY                                                                                        002000
    47 C                   | endif                                                                                          002100
    48 C                   enddo                                                                                            002200
    49 C                   write                      outrec                                                                002300
                                                                                           9 
    50 C                   SETON                                                         LR----                             002400
    47 C/DEFINE ABC                                                                                              971104     002500
    51 C/IF DEFINED(ABC)                                                                                         971104     002600
    52 C                   MOVEL                      'x'           Y                10                                     002700
    54 C                   MOVEL                      'x'           Z                10                                     002800
    55 C/ELSE                                                                                                    971104     002900
   10 
------ C                   MOVEL     ' '           Y                10                                           971104     003000
------ C                   MOVEL     ' '           Z                10                                           971104     003100
    56 C/ENDIF                                                                                                   971104     003200
Line   <---------------------- Source Specifications ----------------------------><---- Comments ----> Do  Page  Change Src Seq
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line  Date   Id  Number
    57=OOUTREC                                                                                                             6000001
        *--------------------------------------------------------------------------------------------*                     6
        * RPG record format  . . . . :  OUTREC                                                       *                     6
        * External format  . . . . . :  OUTREC : MYLIB/OUTFILE                                       *                     6
        *--------------------------------------------------------------------------------------------*                     6
    58=O                       FLDY               100A CHAR      100                                                       6000002
    59=O                       FLDZ               132A CHAR       32                                                       6000003
    60=O                       GRAPHFLD           156G GRPH       12 835                                                   6000004
       * * * * *   E N D   O F   S O U R C E   * * * * *
 1a  *NOSRCSTMT Source Heading
The source heading shown in the above example was generated with OPTION(*NOSRCSTMT) specified.
Line Number
Starts at 1 and increments by 1 for each source or generated record. Use this number when debugging using statement numbers.
Ruler Line
This line adjusts when indentation is specified.
Do Number
Identifies the level of the structured operations. This number will not appear if indentation is requested.
Page Line
Shows the first 5 columns of the source record.
Source Id
Identifies the source (either /COPY or DDS) of the record. For /COPY members, it can be used to obtain the external member name from the /COPY member table.
Sequence Number (on right side of listing)
Shows the SEU sequence number of the record from a member in a source physical file. Shows an incremental number for records from a /COPY member or records generated from DDS.
 1b  *SRCSTMT Source Heading
When OPTION(*SRCSTMT) is specified, the source heading changes to:
   1b 
Seq    <---------------------- Source Specifications ----------------------------><---- Comments ----> Do  Page  Change Statement
Number ....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10 Num Line  Date   Number
The Ruler Line, Do Number, and Page Line remain unchanged.
Sequence Number (on left side of listing)
Shows the SEU sequence number of the record from a member in a source physical file. Shows an incremental number for records from a /COPY member or records generated from DDS.
Statement Number
Shows the statement number generated from the source ID number and the SEU sequence number as follows:
stmt_num = source_ID * 1000000 + source_SEU_sequence_number
Use this number when debugging using statement numbers.
 2  Compiler Options in Effect
Identifies the compiler options in effect. Displayed when compile-option keywords are specified on the control specification.
 3  File/Record Information
Identifies the externally described file and the records it contains.
 4  DDS Information
Identifies from which externally described file the field information is extracted. Shows the prefix value, if specified. Shows the format record text if specified in the DDS.
 5  Generated Specifications
Shows the specifications generated from the DDS, indicated by '=' beside the Line Number. Shows up to 50 characters of field text if it is specified in the DDS. Shows the initial value as specified by the INZ keyword on the definition specification. If INZ(*EXTDFT) is specified for externally described data structure subfields, the DDS default value is displayed. Default values that are too long to fit on one line are truncated and suffixed with '...'.
 6  /COPY Member Information
Identifies which /COPY member is used. Shows the member text, if any. Shows the date and time of the last change to the member.
 7  /COPY Member Records
Shows the records from the /COPY member, indicated by a '+' beside the Line Number.
 8  Indentation
Shows how structured operations appear when you request that they be marked.
 9  Indicator Usage
Shows position of unused indicators, when an indicator is used.
 10  OPTION(*SHOWSKP) Usage
Shows two statements excluded by an /IF directive, indicated by a '-------' beside the statements. If the OPTION(*NOSHOWSKP) was specified these two statements would be replaced by: LINES EXCLUDED: 2.


[ Top of Page | Previous Page | Next Page | Contents | Index ]