We are trying to parse Cobol sources.
Having a SELECT with ‘MASS-UPDATE’ clause causes the parser to fail, while the compiler has no problems with it.
Versions used:
Cobol: AcuCobol version 10.2.1, fixed format
SonarQube: Enterprise Edition Version 9.6.1 (build 59531)
– extract from the parser logging –
ERROR: Unable to parse COBOL source file : /build/builds/_NwxSV3v/0/dataserver-utilities/tdeltaplayground/sonar-parse-errors/cobol-src/source/PP0021 at line 9
Original contents starting from line 1 till line 19:
IDENTIFICATION DIVISION.
PROGRAM-ID. PP0021.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT INT-FILE ASSIGN TO RANDOM INT-FILE-NAME
ORGANIZATION IS LINE SEQUENTIAL
* The (WITH) MASS-UPDATE clause causes the parser to
* fail:
LOCK MODE IS EXCLUSIVE WITH MASS-UPDATE
FILE STATUS IS FILE-STATUS.
DATA DIVISION.
FILE SECTION.
FD INT-FILE.
01 INT-REC PIC X(80).
WORKING-STORAGE SECTION.
01 INT-FILE-NAME PIC X(80).
01 FILE-STATUS PIC 9(02).
PROCEDURE DIVISION.
GOBACK.
Preprocessed contents:
Parse error at line 9:
1: IDENTIFICATION DIVISION .
2: PROGRAM-ID . PP0021 .
3: INPUT-OUTPUT SECTION .
4: FILE-CONTROL .
5: SELECT INT-FILE ASSIGN TO RANDOM INT-FILE-NAME
6: ORGANIZATION IS LINE SEQUENTIAL
9: LOCK MODE IS EXCLUSIVE WITH MASS-UPDATE
^
10: FILE STATUS IS FILE-STATUS .
11: DATA DIVISION .
12: FILE SECTION .
13: FD INT-FILE .
14: 01 INT-REC PIC X ( 80 ) .
15: WORKING-STORAGE SECTION .
16: 01 INT-FILE-NAME PIC X
We would like you to fix this issue.