title: COBOL plugin reports parse errors
body: <p>Our team is running SonarQube instances for a variety of languages (java,pl/sql,C,C++).</p>
  
  <p>Recently we were asked to run code quality analysis on COBOL code. </p>
  
  <p>We have received some COBOL code from the development team and ran a Jenkins job.</p>
  
  <p>During the analysis however we see some <em>parsing errors</em>. </p>
  
  <p>Next to that no issues are found according to the analysis. </p>
  
  <p>That is the very first time that we do not encounter any issues in an analysis so we are somewhat <em>suspicious</em> and wonder if the COBOL code is actually parsed in the correct way.</p>
  
  <p>FYI we do not have any COBOL background ourselves. </p>
  
  <p>I have pasted below some of the errors shown during the analysis. </p>
  
  <p>In the end the analysis reports: <em>09:01:51.131 INFO  - 2/2 files analyzed</em>, but since we are not COBOL experts we wonder if the code is actually analyzed corretly?</p>
  
  <p><strong>Details:</strong></p>
  
  <ul>
  <li>COBOL plugin: 1.17</li>
  <li>SonarQube: 3.7.3</li>
  </ul>
  
  <p><strong>Questions we raised towards the development team:</strong></p>
  
  <ul>
  <li>The Cobol dialect (e.g : cobol-2002, microfocus, acucobol,tandem,gcos):
  <em>Tandem/NonStop    COBOL85 - T9257H01 - (15 MAR 09),      SCOBOLX   SCREEN COBOL - T0528H01</em> - (01FEB2009),   and ECOBOL (same as COBOL85, but different System Procedure Calls)</li>
  <li>What is the filename structure (e.g : myfile.cob): 
  <em>\system.$vol.subvol.filename   eg. \tdsdev.$dvs010.tdsrcdgs.gss2211</em></li>
  <li>The Source format (e.g : fixed or free.  In fixed format, there is both a left and right margin. In free format, there is no margin and the indicator area is expected in column 1.):
  <em>free</em></li>
  <li>If the format is fixed, what is the tab width?  Number of expanded spaces for a tab character (' '):
  <em>No, it is free format</em></li>
  <li>Do you use copybooks , if so what are the file extentions ? (cpy,cbl ?):
  <em>Yes, we do use copybooks.  Tandem filenames are always having the same format :  \system.$vol.subvol.filename</em></li>
  </ul>
  
  <p><strong>Parse errors</strong>
  *Preprocessed contents: </p>
  
  <pre><code>Parse error at line 279:
    279:  01 MISCELLANEOUS-LITERALS .
         ^
    283:  05 L-ERROR-SIZE-ERROR PIC S9 ( 4 ) COMP VALUE 1 .
    284:  05 L-ERROR-CONTRACT-ORDER PIC S9 ( 4 ) COMP VALUE 2 .
    285:  05 L-ERROR-ORDER-SUBS-TRAFFIC PIC S9 (*
  </code></pre>
  
  <p>*Preprocessed contents: </p>
  
  <pre><code>Parse error at line 55:
     55:  01 LITERALS .
         ^
     56:  02 L-NO-CONTEXT-FOUND PIC 9 ( 4 ) COMP VALUE 5 .
     57:  02 L-ERROR-REQUEST-CODE PIC 9 ( 4 ) COMP VALUE 14 .
     58:  02 L-ERROR-READ-FIRST PIC 9 (
  09:01:51.124 ERROR - Unable to parse COBOL source file : /home/ecbbuild/cobol/dvs010.tdsrcdgs.gsu2001l at line 279
  Original contents starting from line 259 till line 299:
  *                       48 : dependent end-pay
  *
  *                       When items is produced by ENDPAY request,
  *                       50 is added to the values above
  *
  *    Encoding of internal-sort, when usage-plan discounts:
  *
  *       99PPPPPPPPQQQQQQFF
  *       PPPPPPPP        Usage-plan-product-nr from line-total-adjust
  *       QQQQQQ          First-start-date converted to georgian date,
  *       FF              Usage-plan-display-aggregate-flag N=1, Y=2, D=3
  *
  *    Encoding of internal-sort, when information-item-type:
  *
  *       00PPPPPPPPYYYYMMDD
  *       PPPPPPPP        product-reference-code OF inv-item-table
  *       YYYYMMDD        item-from-date         OF inv-item-table
  *
  </code></pre>
  
  <hr>
  
  <pre><code>?SECTION gsu2001-error-literals
     01 miscellaneous-literals.
  *
  *     Reply-codes:
  *
       05 l-error-size-error             pic S9(4) comp value  1.
       05 l-error-contract-order         pic S9(4) comp value  2.
       05 l-error-order-subs-traffic     pic S9(4) comp value  3.
       05 l-error-date-interval          pic S9(4) comp value  4.
       05 l-error-inv-item               pic S9(4) comp value  5.
       05 l-error-update-sold-product    pic S9(4) comp value  6.
       05 l-error-inv-item-text          pic S9(4) comp value  7.
       05 l-error-delete-sold-item-text  pic S9(4) comp value  9.
       05 l-error-sold-item-text         pic S9(4) comp value 14.
  *-FAD-MOD-15.04.2005-#446902--------------------------------------------------*
  *     05 l-error-line-total             pic S9(4) comp value 15.
  *     05 l-error-line-total-adjust      pic S9(4) comp value 17.
       05 l-error-contract               pic S9(4) comp value 30.
       05 l-original-invoice-not-found   pic s9(4) comp value 38.
  *     05 l-dup-error                    pic s9(4) comp value 39.
  *     05 l-error-reading-cost-detail    pic s9(4) comp value 40.
  ***FIX IT - START*
  </code></pre>