Skip to content

New diagnostic error on PIC X.. #1917

@delevoye

Description

@delevoye

LINKED WITH #1911, #1749 and #1899

Describe the bug
In DATA DIVISION, two consecutive dots at the end of a variable declaration should yield a parsing error.
IBM error: "X."was not a valid combination of"PICTURE"string characters. A"PICTURE"string of"S9(1)"was assumed.

Sample

       IDENTIFICATION DIVISION.
       PROGRAM-ID. Pgm.
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       SPECIAL-NAMES. DECIMAL-POINT IS COMMA.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 A pic X.
      *Error: "X."was not a valid combination of"PICTURE"string
      *       characters. A"PICTURE"string of"S9(1)"was assumed.
       01 B pic X..
      *Error: "."was invalid. Scanning was resumed at the next area
      *       "A" item, level-number or the start of the next clause.
       01 C pic X. .
      
      *Error: "."was invalid. Scanning was resumed at the next area
      *       "A" item, level-number or the start of the next clause.
      *Warning: A blank was missing before character "." in column 16.
      *         A blank was assumed.
       01 var1..
          05 var2 pic XX.
      *Error: "VAR4"was invalid. Scanning was resumed at the next area
      *       "A"item, level-number, or the start of the next clause.
      *Error : A duplicate"PICTURE"clause was found in a data
      *        description entry. The duplicate clause was discarded.
      *Error : Character(s)"5"were found as"PICTURE"string character(s).
      *       A"PICTURE"string of"S9(1)"was assumed.
          05 var3 pic X.05 var4 pic X.
      
      * OK
       01 var1Bis.
      * OK
          05 var5 pic X. 05 var6 pic X.
      
       PROCEDURE DIVISION.
           move A to B
           .
       END PROGRAM Pgm.

Without decimal point is comma, we get the same erors:

       IDENTIFICATION DIVISION.
       PROGRAM-ID. Pgm.
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 A pic X.
      *Error: "X."was not a valid combination of"PICTURE"string
      *       characters. A"PICTURE"string of"S9(1)"was assumed.
       01 B pic X..
      *Error: "."was invalid. Scanning was resumed at the next area
      *       "A" item, level-number or the start of the next clause.
       01 C pic X. .
      
      *Error: "."was invalid. Scanning was resumed at the next area
      *       "A" item, level-number or the start of the next clause.
      *Warning: A blank was missing before character "." in column 16.
      *         A blank was assumed.
       01 var1..
          05 var2 pic XX.
      *Error: "VAR4"was invalid. Scanning was resumed at the next area
      *       "A"item, level-number, or the start of the next clause.
      *Error : A duplicate"PICTURE"clause was found in a data
      *        description entry. The duplicate clause was discarded.
      *Error : Character(s)"5"were found as"PICTURE"string character(s).
      *       A"PICTURE"string of"S9(1)"was assumed.
          05 var3 pic X.05 var4 pic X.
      
      * OK
       01 var1Bis.
      * OK
          05 var5 pic X. 05 var6 pic X.
      
       PROCEDURE DIVISION.
           move A to B
           .
       END PROGRAM Pgm.

EDIT : more complete example.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions