For Programmers: Free Programming Magazines  


Home > Archive > Cobol > May 2005 > Where are spaces required in COBOL source code?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Where are spaces required in COBOL source code?
epc8@juno.com

2005-05-30, 3:55 pm

While playing around with the COBOL12 compiler (discussed elsewhere
recently in this newsgroup), I ran into a few peculiarities. This is a
DOS compiler that looks like a subset of 74 standard COBOL but has some
extensions and some omissions. Its display is unusual since it uses a
graphics mode to display text. Anyway I noticed two strange things. The
compiler does not accept blank lines in source code and it requires a
variable name to be separated by at least one space from the
parentheses enclosing a subscript (or an expression denoting reference
modification). An old CP/M era compiler also had this requirement for
subscripts (of course there was no reference modification).

1. Was this ever part of a COBOL standard?

2. I sometimes find it puzzling that spaces seem to be required around
certain things in COBOL when I don't expect them to be. For example
after commas (in CALL), around the colon in reference modification (at
least in the compilers I've tested) and around operators in a COMPUTE
expression.

Please note that the first language I learned was FORTRAN using
fixed-form (punched card) format. There spaces are only meaningful
inside string literals.

Is there a general rule about this for COBOL and has it changed with
different versions of the standard?

(Sorry if this is a FAQ.)

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com