gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [open-cobol-list] The minimal program


From: John R. Culleton
Subject: Re: [open-cobol-list] The minimal program
Date: Wed Apr 5 07:24:01 2006
User-agent: KMail/1.9.1

On Tuesday 04 April 2006 19:22, Bill Klein wrote:
> John,
>   I may be mistaken, but I think you do or have worked on IBM mainframes.
> You will find that any compiler from VS COBOL II, R3 (circa 1987) onward
> WILL compile a program with just the Identification Division header and a
> Program-ID paragraph.
>
> Personally, I have always "questioned" the usefulness of a program without
> a Procedure Division.  (According to the '85 Standard, this is equivalent
> to a program with a single
>     Exit Program
> statement in it).
>
> The only (semi-) useful thing that such a program MIGHT do is if you have a
> DATA DIVISION with an EXTERNAL item in its working-storage.  This could be
> used to "pre-allocate" some storage, but I think there are usually better
> ways to do this.
>
> FYI,
>   There is not now (nor has there ever been) any suggestion that the ANSI
> Standard will eliminate the need for an Identification Division.  They
> have, however, made the HEADER optional.
>
> On the other hand, Micro Focus (and possibly some other compilers) DO have
> the Identification Division as "optional".  In this case, the Program-Id
> "defaults" to the source code file name.  This is how/why Micro Focus will
> compile the following as a "valid" program.
>
>     Display "Hello World".

You are right, I began on IBM mainframes in 1968. By 1987 I had
moved on to superminis like the HP 3000, the AS400 and to desktop
machines. But as a programmer I always "think in COBOL", whether
using that language or another. 

COBOL format and syntax were originally designed to resemble in
part English as written in a formal business procedure of decades
ago.  I still think that is part of its strength. The trend in
recent years has been to wander farther and farther from that
original design.  That is IMO regrettable. Hence my standard
program template includes all four divisions and several other
headers.  With a template there is no need to rekey these
headers, so they come "free" and serve as an outline for writing
and internally documenting the program. 

John Culleton



reply via email to

[Prev in Thread] Current Thread [Next in Thread]