Re: Stop Run vs GoBack



On 6/25/2007 at 9:18 AM, in message
<62nv73llefa7mdevhm4gb5bk50uu6t9r6j@xxxxxxx>, Howard
Brazee<howard@xxxxxxxxxx> wrote:
On Sun, 24 Jun 2007 18:35:20 GMT, "William M. Klein"
<wmklein@xxxxxxxxxxxxxxxxx> wrote:

3) COBOL (unlike many - possibly MOST - other languages) does NOT require

you to
"declare" a program as either a "MAIN" or "SUB" at compile time. (Having

a
LINKAGE section *implies* that you are a subprogram, but that is neither
required nor universally even true if you access the fields in it).

The LINKAGE section had some interesting variations. On the Univac
9030 (around 1980), most all of our data fields were in the Linkage
Division for our pseudo-conversational programs. They were called by
the program that ran on-line stuff. Other computer systems got the
same results without a LINKAGE section.

Perhaps I shouldn't start this, but...

While use of a LINKAGE SECTION seems to imply that the program is a
sub-program, it is not necessarily true for two reasons.
1) As you (or someone) mentioned, main programs on IBM mainframes can have a
LINKAGE SECTION to receive "command line parameters" from the operating
environment.
2) For those COBOLs without BASED storage (which is pretty much all of them,
as far as I can tell, with a few exceptions (OpenCobol and Fujitsu-Siemens
COBOL2000 are the only ones I know about) you have to use the linkage
section to be able to address dynamically allocated storage (such as storage
allocated using GETMAIN in CICS or storage using the new COBOL "ALLOCATE"
statement. Even in FS COBOL2000 the BASED clause is only allowed on a
LINKAGE SECTION item, so this almost defeats its purpose.

Maybe the LINKAGE SECTION should be renamed the BASED-STORAGE SECTION. :-)

Frank



.



Relevant Pages

  • Re: Stop Run vs GoBack
    ... LINKAGE SECTION to receive "command line parameters" from the operating ... section to be able to address dynamically allocated storage (such as ... allocated using GETMAIN in CICS or storage using the new COBOL "ALLOCATE" ... L/S items. ...
    (comp.lang.cobol)
  • Re: Attribute BASED and LINKAGE SECTION
    ... Allocate Based1 Returning Ptr1 ... it seems to me that based items in linkage should ... like local-storage based items. ...
    (comp.lang.cobol)
  • Re: Occurs Depending Memory Use
    ... The distiction that I made was between FD areas and Linkage which Bill ... create v. allocate, I was trying to use the correct terminology (as ... Section because there's no addressability to anything until the FD's are ...
    (comp.lang.cobol)
  • Re: Attribute BASED and LINKAGE SECTION
    ... subject to more than one ALLOCATE without an intervening FREE? ... it seems to me that based items in linkage should ... like local-storage based items. ... association ends "at the end of the life cycle of the data items ...
    (comp.lang.cobol)
  • Re: Attribute BASED and LINKAGE SECTION
    ... Isn't a LINKAGE SECTION item implicitly BASED? ... allocated storage should be assigned to ... procedure division using linkage-parm1. ... data-name-1 shall not contain a BASED clause or a REDEFINES clause. ...
    (comp.lang.cobol)