Where are spaces required in COBOL source code?
- From: epc8@xxxxxxxx
- Date: 26 May 2005 17:37:40 -0700
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.)
.
- Follow-Ups:
- Re: Where are spaces required in COBOL source code?
- From: Chuck Stevens
- Re: Where are spaces required in COBOL source code?
- From: Chuck Stevens
- Re: Where are spaces required in COBOL source code?
- Prev by Date: Re: Linking Problem
- Next by Date: Re: Outsourcing Software In India
- Previous by thread: Dumb "figurative constant" rules
- Next by thread: Re: Where are spaces required in COBOL source code?
- Index(es):
Relevant Pages
|