# Parse-error with 'NO' clause in ACCEPT statement. (AcuCobol)

**URL:** <https://community.sonarsource.com/t/parse-error-with-no-clause-in-accept-statement-acucobol/88409>\
**Category:** SonarQube Server / Community Build\
**Tags:** parse-error, cobol, sonarqube\
**Created:** [March 31, 2023, 12:43pm UTC](https://community.sonarsource.com/t/parse-error-with-no-clause-in-accept-statement-acucobol/88409 "2023-03-31T12:43:21Z")\
**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 31, 2023, 12:43pm UTC](https://community.sonarsource.com/t/parse-error-with-no-clause-in-accept-statement-acucobol/88409/1 "2023-03-31T12:43:21Z")

</div>

We are trying to parse Cobol sources.

Having a ‘NO’ clause by itself in an accept statement 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 –

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

Original contents starting from line 1 till line 8:
       IDENTIFICATION DIVISION.
       PROGRAM-ID. PP0031.
       WORKING-STORAGE SECTION.
       01 VARIABLE-1 PIC X(02).
       PROCEDURE DIVISION.
      * The 'NO' clause by itself causes a parsing error:
           ACCEPT VARIABLE-1 NO POS 10
           GOBACK.

Preprocessed contents: 
Parse error at line 7:

    1: IDENTIFICATION DIVISION .
    2: PROGRAM-ID . PP0031 .
    3: WORKING-STORAGE SECTION .
    4: 01 VARIABLE-1 PIC X ( 02 ) .
    5: PROCEDURE DIVISION .
    7: ACCEPT VARIABLE-1 NO POS 10
                            ^
    8: GOBACK .
    9: EOF

```

Please fix this parse-error

---

<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:13am UTC](https://community.sonarsource.com/t/parse-error-with-no-clause-in-accept-statement-acucobol/88409/3 "2023-04-06T10:13:22Z")

</div>

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