ILE COBOL Programmer's Guide

Using the COBOL Syntax Checker in SEU

To use the COBOL syntax checker in SEU, specify the TYPE (CBLLE) parameter of the STRSEU command. The COBOL syntax checker checks each line for errors as you enter new lines or change existing lines. Incorrect source statements are identified and error messages displayed, allowing you to correct the errors before compiling the program.

Any time a source line is entered or changed, other lines of source code can be syntax checked as part of that unit of syntax-checking. The length of a single unit of syntax-checking is determined by extending from an entered or changed line as follows:

Because the COBOL syntax checker checks only one sentence as it is entered or changed, independent of sentences that precede or follow it, only syntax errors within each source statement can be detected. No inter-relational errors, such as undefined names and incorrect references to names, are detected. These errors are detected by the ILE COBOL compiler when the program is compiled.

Conversely, if a change is made to a sentence that is part of a comment-entry for an optional paragraph of the Identification Division, the syntax checker is not able to recognize that the context permits any combination of characters to be entered. It may generate multiple errors as it attempts to identify the contents of the sentence as a valid COBOL statement. This will be avoided if the comment-entry is written as a single sentence that starts on the same line as the paragraph name, or if the comment-entry is replaced by a series of comment lines.

If there is an error in a unit of syntax-checking, the part of the unit identified as being in error is presented in reverse image. The message at the bottom of the display refers to the first error in the unit.

Syntax checking occurs as you enter the source code. Error messages are generated by lines consisting of incomplete statements. These disappear when the statements are completed, as in the example:

Figure 4. COBOL Syntax Checker error message generated for an incomplete statement

+--------------------------------------------------------------------------------+
|Columns . . . :    1  71            Edit                     TESTLIB/QCBLLESRC  |
|SEU==> ____________________________________________________________    ADDATOB  |
|FMT CB ......-A+++B+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  |
|        *************** Beginning of data ************************************* |
|0000.10        IDENTIFICATION DIVISION.                                         |
|0000.20        PROGRAM-ID. ADDATOB.                                             |
|0000.30        ENVIRONMENT DIVISION.                                            |
|0000.40        CONFIGURATION SECTION.                                           |
|0000.50          SOURCE-COMPUTER. IBM-ISERIES.                                  |
|0000.60          OBJECT-COMPUTER. IBM-ISERIES.                                  |
|0000.70        DATA DIVISION.                                                   |
|0000.80        WORKING-STORAGE SECTION.                                         |
|0000.90        01  A     PIC S9(8) VALUE 5.                                     |
|0001.00        01  B     PIC S9(8) VALUE 10.                                    |
|0001.10        PROCEDURE DIVISION.                                              |
|0001.20        MAINLINE.                                                        |
|0001.30            MOVE A                                                       |
|'''''''                                                                         |
|        ****************** End of data **************************************** |
|                                                                                |
|F3=Exit   F4=Prompt   F5=Refresh   F9=Retrieve   F10=Cursor   F11=Toggle        |
|F16=Repeat find       F17=Repeat change          F24=More keys                  |
|COBOL reserved word or special character 'TO' expected. 'TO' assumed.        +  |
+--------------------------------------------------------------------------------+

Figure 5. COBOL Syntax Checker error message disappears after statement is completed

+--------------------------------------------------------------------------------+
|Columns . . . :    1  71            Edit                     TESTLIB/QCBLLESRC  |
|SEU==> ____________________________________________________________    ADDATOB  |
|FMT CB ......-A+++B+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  |
|        *************** Beginning of data ************************************* |
|0000.40        IDENTIFICATION DIVISION.                                         |
|0000.50        PROGRAM-ID. ADDATOB.                                             |
|0000.60        ENVIRONMENT DIVISION.                                            |
|0000.70        CONFIGURATION SECTION.                                           |
|0000.80          SOURCE-COMPUTER. IBM-ISERIES.                                  |
|0000.90          OBJECT-COMPUTER. IBM-ISERIES.                                  |
|0000.91        DATA DIVISION.                                                   |
|0000.92        WORKING-STORAGE SECTION.                                         |
|0000.93        01  A     PIC S9(8) VALUE 5.                                     |
|0000.94        01  B     PIC S9(8) VALUE 10.                                    |
|0001.00        PROCEDURE DIVISION.                                              |
|0001.10        MAINLINE.                                                        |
|0002.00            MOVE A                                                       |
|0003.00            TO B.                                                        |
|'''''''                                                                         |
|        ****************** End of data **************************************** |
|F3=Exit   F4=Prompt   F5=Refresh   F9=Retrieve   F10=Cursor   F11=Toggle        |
|F16=Repeat find       F17=Repeat change          F24=More keys                  |
|                                                                                |
+--------------------------------------------------------------------------------+

An error message is generated after the first line is entered and disappears after the second line is entered, when the statement is completed.

The following regulations apply to syntax checking for ILE COBOL source code:


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