legsem / legstar-cob2xsd

Automatically exported from code.google.com/p/legstar-cob2xsd
Other
3 stars 2 forks source link

VALUE clause for level 88 requires a space after each comma #59

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This will parse:

88  CUST-NFE-ENABLED        value 1, 2, 9.

But this will not:

88  CUST-NFE-ENABLED        value 1,2,9.

What version of the product are you using? On what operating system?

0.3.5 Linux

Please provide any additional information below.

Original issue reported on code.google.com by franc...@gmail.com on 3 Aug 2012 at 9:18

GoogleCodeExporter commented 9 years ago
Actually, if I try to compile your statement with IBM Enterprise COBOL for z/OS 
 3.3.0, I get these warnings:

   000518C                          88    CUST-NFE-ENABLED        value 1,2,9.
 ==000518==> IGYDS0001-W A blank was missing before character "2" in column 57.   A blank was assumed.
 ==000518==> IGYDS0001-W A blank was missing before character "9" in column 59.   A blank was assumed.

The Language Reference manual confirms this, even for the more recent Version 4 
Release 2 of Enterprise COBOL for z/OS (page 48):

  Period {.b}, Comma {,b}, Semicolon {;b}
    A separator comma is composed of a comma followed by a space. A
    separator period is composed of a period followed by a space. A separator
    semicolon is composed of a semicolon followed by a space.

What COBOL compiler are you using?

Original comment by fady.mou...@gmail.com on 4 Aug 2012 at 11:07

GoogleCodeExporter commented 9 years ago
This is Alpha VMS COBOL. Not sure if that compiler gives warnings or not for 
this statement.

Even if it would result in compiler warnings, it should still parse in your 
grammar, right, since it's not an actual error.

Original comment by franc...@gmail.com on 4 Aug 2012 at 2:17

GoogleCodeExporter commented 9 years ago
IBM compiler warnings usually mean that some other combination of compiler 
options will result in errors.

In this case, if I specify the "DECIMAL-POINT IS COMMA" option for instance, 
the same line of code now gives errors:

   000520C                          88    CUST-NFE-ENABLED        value 1,2,9.
 ==000520==> IGYDS0001-W A blank was missing before character "," in column 58. A blank was
                         assumed.
 ==000520==> IGYGR1240-E The number of digit positions or the position of the decimal point in
                         level-88 "VALUE" literal "1,2" was not compatible with the "PICTURE"
                         definition of the conditional variable.  The literal was discarded.
 ==000520==> IGYGR1240-E The number of digit positions or the position of the decimal point in
                         level-88 "VALUE" literal ",9" was not compatible with the "PICTURE"
                         definition of the conditional variable.  The literal was discarded.

If I put back space characters after the commas, the code compiles fine.

I guess the VMS COBOL lexer is smarter.

Original comment by fady.mou...@gmail.com on 4 Aug 2012 at 3:52

GoogleCodeExporter commented 9 years ago
Well I think we can live this with this, it's pretty easy to change the code to 
fix it.

Original comment by franc...@gmail.com on 6 Aug 2012 at 3:27

GoogleCodeExporter commented 9 years ago

Original comment by fady.mou...@gmail.com on 31 May 2013 at 7:42