Re: Stop Run vs GoBack




"Frank Swarbrick" <Frank.Swarbrick@xxxxxxxxxxxxxx> schrieb im Newsbeitrag
news:46800366.6F0F.0085.0@xxxxxxxxxxxxxxxxx
<snip>
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.
:-)

OC, as per 2002 standard, allows BASED in WORKING/LINKAGE/LOCAL
sections.
You can also use the SET verb to set (sic) the addressability of
L/S items.

Of course, ABSENCE of L/S does not imply anything about a
program either.
In fact, I have 2 ported apps that each contain a prog (without L/S) that is
both run as a free-standing (main) program and as a callable
module.
Original machine environment for these app's is unknown
except it was "big iron".
Interestingly enough, both of these progs have a single exit
point which is an EXIT PROGRAM as the last statement in
the source. (That, at least, is the state in which I received them;
I can not say if they have been modified from the real original)

Roger


.



Relevant Pages

  • Re: Stop Run vs GoBack
    ... The LINKAGE section had some interesting variations. ... For those COBOLs without BASED storage (which is pretty much all of them, ... allocated using GETMAIN in CICS or storage using the new COBOL "ALLOCATE" ...
    (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)