# Trailing commas cause parsing errors when parsing AcuCobol sources

**URL:** <https://community.sonarsource.com/t/trailing-commas-cause-parsing-errors-when-parsing-acucobol-sources/88175>\
**Category:** SonarQube Server / Community Build\
**Tags:** parse-error, cobol, sonarqube\
**Created:** [March 28, 2023, 1:28pm UTC](https://community.sonarsource.com/t/trailing-commas-cause-parsing-errors-when-parsing-acucobol-sources/88175 "2023-03-28T13:28:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jos\_Abrahams](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jos_abrahams/32/43608_2.png) [@Jos\_Abrahams](https://community.sonarsource.com/u/Jos_Abrahams)\
**Post date:** [March 28, 2023, 1:28pm UTC](https://community.sonarsource.com/t/trailing-commas-cause-parsing-errors-when-parsing-acucobol-sources/88175/1 "2023-03-28T13:28:33Z")

</div>

We are trying to parse Cobol sources.

Trailing comma’s cause a lot of parsing errors, while the compiler has no problems with them.  
So why don’t you ignore comma’s alltogether for AcuCobol (like you apparently do for other Cobol dialects)

Versions used:  
Cobol: AcuCobol version 10.2.1, fixed format  
SonarQube: Enterprise Edition Version 9.6.1 (build 59531)

– extract from the parser logging –

```auto
ERROR: Unable to parse COBOL source file : /build/builds/_NwxSV3v/0/dataserver-utilities/tdeltaplayground/sonar-parse-errors/cobol-src/source/PP0020 at line 13

Original contents starting from line 1 till line 13:
       IDENTIFICATION DIVISION.
       PROGRAM-ID. PP0020.
       WORKING-STORAGE SECTION.
       01 VARIABLE PIC 9.
       PROCEDURE DIVISION.
           MOVE 1 TO VARIABLE,
           GOBACK.

Preprocessed contents: 
Parse error at line 13:

    1: IDENTIFICATION DIVISION .
    2: PROGRAM-ID . PP0020 .
    3: WORKING-STORAGE SECTION .
    4: 01 VARIABLE PIC 9 .
    5: PROCEDURE DIVISION .
   12: MOVE 1 TO VARIABLE ,
   13: GOBACK .
       ^
   14: EOF

```

---

<div class="post-metadata">

**Author:** ![pynicolas](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/pynicolas/32/675_2.png) [@pynicolas](https://community.sonarsource.com/u/pynicolas)\
**Post date:** [April 6, 2023, 10:10am UTC](https://community.sonarsource.com/t/trailing-commas-cause-parsing-errors-when-parsing-acucobol-sources/88175/4 "2023-04-06T10:10:21Z")

</div>

Thank you for your feedback.  
TIcket created: [SONARCOBOL-1653](https://sonarsource.atlassian.net/browse/SONARCOBOL-1653)

We indeed ignore commas except for AcuCOBOL: that’s because we believe we need commas to correctly parse some AcuCOBOL specific syntaxes. Maybe we should revisit this assumption.

If you encounter a lot of parsing errors due to commas, can you please give us a few more examples of various cases? It would help us when we investigate the best way to address this problem.  
Thank you.
