On 08/03/2012 10:40 AM, Charles Mills wrote:
Is anyone a COBOL syntax expert? Is the following valid? (It's not a trick
question: there are no obscure PARM= options and nothing remarkable precedes
the fragment below.) It's not an academic question. The code is accepted
without error by the IBM Enterprise COBOL compiler V4.1, but not by a
proprietary pre-processor, and I'm trying to figure out if the code should
change or if the preprocessor is in error. Changing the code is not trivial:
multiple programs like this, corporate change control processes, etc., etc.

I think it's invalid, that the '.' strings are syntactically-invalid
character literals. Am I missing something?

Starting hint: The REMARKS paragraph heading is only a * comment and not
syntactically significant (I think).

Best viewed in a fixed-width font like Courier. FYI if you can't view it
that way, the leading quote in lines 20-23 is in CC 12 and the trailing
quote in CC 72.
Card columns:
          1         2         3    6         7
1234567890123456789012345678901...0123456789012

00020 *REMARKS.
00021      '*******************   ************'
00022      '* VARIOUS COMMENT-LIKE TEXT      *'
00023      '* VARIOUS COMMENT-LIKE TEXT      *'


Thanks for your help.



Charles

See the COBOL Migration Guide GC23-8527-01:
"REMARKS paragraph -- OS/VS COBOL accepted the REMARKS paragraph. Enterprise COBOL does not accept the REMARKS paragraph. As a replacement, use comment lines beginning with an * in column 7."

And from the COBOL Language Reference:
"A comment line is any line with an asterisk (*) or slash (/) in the indicator area (column 7) of the line. The comment can be written anywhere in Area A and Area B of that line, and can consist of any combination of characters from the character set of the computer."
...
"Multiple comment lines are allowed. Each must begin with either an asterisk (*) or a slash (/) in the indicator area."

From the current language reference, I would say that line 20 is a valid comment, lines 21-23 are not. Perhaps the IBM Compiler still has some residual (and undocumented?) compatibility support for the obsolete "REMARKS" paragraph and is tolerating the lines because of that.

--
Joel C. Ewing,    Bentonville, AR       [email protected] 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to