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: Bill Klein
Subject: RE: [open-cobol-list] The minimal program
Date: Tue Apr 4 16:24:02 2006

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". 

> -----Original Message-----
> From: address@hidden 
> [mailto:address@hidden On 
> Behalf Of John R. Culleton
> Sent: Tuesday, April 04, 2006 9:11 AM
> To: address@hidden
> Cc: Roger While; address@hidden
> Subject: Re: [open-cobol-list] The minimal program
> 
> On Monday 03 April 2006 09:17, Roger While wrote:
> > Bill, correct me if I am wrong.
> > It would appear that the absolute minimal
> > compilable program consists of the one-liner :
> >   PROGRAM-ID. MYPROG.
> >
> > ie. A program or module with entry point "MYPROG"
> > that does nothing.
> >
> > MF compiles this.
> > If this is allowed, we need a small fix in OC.
> > (And if not, we still need a fix for OC)
> >
> > Roger
> 
> I have read of a move by the hyperactive standard fiddlers to 
> make the entire IDENTIFICATION DIVISION optional. If that is done
> then the minimal program would have no statements at all. What
> nonsense!
> 
> In the name of common sense I would state that the minimal
> program consists of the four DIVISION headers, "PROGRAM-ID.
> programname." a single paragraph header, and a STOP RUN statement. 
> 
> COBOL is an English-like self-documenting program aimed at
> business applications, as in "Common Business Oriented Language."
> It is not an exercise in programming minimalism. It has a fixed
> framework of divisions, sections and statements designed to
> provide an expected and hence understandable structure for the
> code of each program.  We had enough of the obscurationist  
> kind of nonsense back in the sixties, with a language
> mercifully long forgotten where the afficianados tried to outdo
> each other in writing totally unreadable "one-liners." 
> 
> I judge COBOL compilers by my own minimalist standard. "Is a
> program that I, (or any journeyman COBOL programmer) am likely to
> write in implementation of a practical business application,
> going to compile and to execute as expected?  
> 
> All the rest is fluff.
> -- 
> John Culleton
> Books with answers to marketing and publishing questions:
> http://wexfordpress.com/tex/shortlist.pdf
> 
> Book coaches, consultants and packagers:
> http://wexfordpress.com/tex/packagers.pdf
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking 
> scripting language
> that extends applications into web and mobile media. Attend 
> the live webcast
> and join the prime developer group breaking into this new 
> coding territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&;
> dat=121642
> _______________________________________________
> open-cobol-list mailing list
> address@hidden
> https://lists.sourceforge.net/lists/listinfo/open-cobol-list
> 




reply via email to

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