Here is what happened.
The program was written in pre-COBOL II (COBOL 85) syntax.  At that time the 
REMARKS paragraph valid (I'm guessing as an IBM extension), and everything 
following it (until the next valid phrase) was treated as, well, remarks 
(a.k.a. comments).  So it used to look something like this:

 IDENTIFICATION DIVISION.
 PROGRAM-ID. MYPGM.

 AUTHOR. THE AUTHOR OF THIS PROGRAM.
 REMARKS.
      '*******************   ************'
      '* VARIOUS COMMENT-LIKE TEXT      *'
      '* VARIOUS COMMENT-LIKE TEXT      *'

When someone attempted to compile it under COBOL II they got an error on the 
REMARKS pargraph, as it was no longer valid.  Some the programmer put the 
comment indicator asterisk in front of REMARKS and tried again.  Low and 
behold, it worked!  


Why did it work?  Because of the AUTHOR paragraph.  (Or perhaps some other 
paragraph; I'm just guessing AUTHOR.)  The IDENTIFICATION DIVISION is defined 
as follows:

    
__________________________________________________________________________________________________
 
   
|                                                                                                 
 |
   | >>__ _IDENTIFICATION_ __DIVISION.__PROGRAM-ID__ ___ 
__program-name_____________________________> |
   |     |_ID_____________|                         
|_._|                                             |
   
|                                                                                                 
 |
   | >__ ______________________________________________ __ ___ 
_____________________________________> |
   |    |_ ____ __ _RECURSIVE___________ __ _________ _|  
|_._|                                       |
   |      |_IS_|  |_COMMON__ _________ _|  
|_PROGRAM_|                                                |
   |              |         |_INITIAL_| 
|                                                             |
   |              |_INITIAL__ ________ 
_|                                                             |
   |                         
|_COMMON_|                                                               |
   
|                                                                                                 
 |
   | >__ ______________________________________ __ 
____________________________________________ ____> |
   |    |_AUTHOR__ ___ __ ___________________ _|  |_INSTALLATION__ ___ __ 
___________________ _|      |
   |              |_._|  | <_______________  |                    |_._|  | 
<_______________  |        |
   |                     |___comment-entry_|_|                           
|___comment-entry_|_|        |
   
|                                                                                                 
 |
   | >__ ____________________________________________ 
______________________________________________> |
   |    |_DATE-WRITTEN__ ___ __ ___________________ 
_|                                                |
   |                    |_._|  | <_______________  
|                                                  |
   |                           
|___comment-entry_|_|                                                  |
   
|                                                                                                 
 |
   | >__ _______________________________________ __ 
________________________________________ ______>< |
   |    |_DATE-COMPILED.__ ___________________ _|  |_SECURITY__ ___ __ 
___________________ _|         |
   |                      | <_______________  |                |_._|  | 
<_______________  |           |
   |                      |___comment-entry_|_|                       
|___comment-entry_|_|           |
   
|                                                                                                 
 |
   
|__________________________________________________________________________________________________|



As you can see, each of the optional paragraphs (AUTHOR, INSTALLATION, 
DATE-WRITTEN, DATE-COMPILED, and SECURITY) may be followed by multiple 
comment-entries.  So what had been "remarks" comment entries are now comment 
entries under whatever "paragraph name" immediately preceeds it.

So technically it is valid COBOL, at least according to the Enterprise COBOL 
standard.  So technically your pre-processor needs to accept it.  Will they fix 
it to accept it?  Umm, good luck!

Your other option is to place the comment asterisks before each "comment-entry".

Note that if the program had not had any of the other optional ID DIVISION 
paragraphs present, simply commenting out REMARKS would not have worked.

It is perhaps worth noting the following, from the Enterprise COBOL 4.2 
Reference manual...

"The following are language elements that Standard COBOL 85 categorized as 
obsolete: 
        * AUTHOR paragraph 
        * Comment entry 
        * DATE-COMPILED paragraph 
        * DATE-WRITTEN paragraph 
        * INSTALLATION paragraph 
        * SECURITY paragraph"

Have fun!

Frank




>________________________________
> From: Charles Mills <[email protected]>
>To: [email protected] 
>Sent: Friday, August 3, 2012 9:40 AM
>Subject: Is this valid COBOL syntax?
> 
>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 
>
>
>----------------------------------------------------------------------
>For IBM-MAIN subscribe / signoff / archive access instructions,
>send email to [email protected] with the message: INFO IBM-MAIN
>
>
>

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

Reply via email to