COBOL plugin reports parse errors -


our team running sonarqube instances variety of languages (java,pl/sql,c,c++).

recently asked run code quality analysis on cobol code.

we have received cobol code development team , ran jenkins job.

during analysis see parsing errors.

next no issues found according analysis.

that first time not encounter issues in analysis suspicious , wonder if cobol code parsed in correct way.

fyi not have cobol background ourselves.

i have pasted below of errors shown during analysis.

in end analysis reports: 09:01:51.131 info - 2/2 files analyzed, since not cobol experts wonder if code analyzed corretly?

details:

  • cobol plugin: 1.17
  • sonarqube: 3.7.3

questions raised towards development team:

  • the cobol dialect (e.g : cobol-2002, microfocus, acucobol,tandem,gcos): tandem/nonstop cobol85 - t9257h01 - (15 mar 09), scobolx screen cobol - t0528h01 - (01feb2009), , ecobol (same cobol85, different system procedure calls)
  • what filename structure (e.g : myfile.cob): \system.$vol.subvol.filename eg. \tdsdev.$dvs010.tdsrcdgs.gss2211
  • the source format (e.g : fixed or free. in fixed format, there both left , right margin. in free format, there no margin , indicator area expected in column 1.): free
  • if format fixed, tab width? number of expanded spaces tab character (' '): no, free format
  • do use copybooks , if file extentions ? (cpy,cbl ?): yes, use copybooks. tandem filenames having same format : \system.$vol.subvol.filename

parse errors *preprocessed contents:

parse error @ 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 (* 

*preprocessed contents:

parse error @ 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 parse cobol source file : /home/ecbbuild/cobol/dvs010.tdsrcdgs.gsu2001l @ line 279 original contents starting line 259 till line 299: *                       48 : dependent end-pay * *                       when items produced endpay request, *                       50 added values above * *    encoding of internal-sort, when usage-plan discounts: * *       99ppppppppqqqqqqff *       pppppppp        usage-plan-product-nr line-total-adjust *       qqqqqq          first-start-date converted 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 * 

?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 - start* 

just wild guess part: make sure process code provided including leading whitespace. cobol not free-format (at leat not before cobol 2002), positions matter lot - asterisk marking comment must @ column 7 etc.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -