Re: Linkage and Nested Subprograms




"LX-i" <lxi0007@xxxxxxxxxxxx> wrote in message
news:ba95e$4420a10a$45491d7a$14101@xxxxxxxxxxxxxx
With this discussion about nested subprograms, there's something that's
bugged me, but I'm not sure how to get around it (or if it can be gotten
around). If I have a subprogram, that itself has nested subprograms, only
the "main" subprogram has the linkage section visible. Is there a way to
make all the nested subprograms have visibility of the "main" subprogram's
linkage section (short of defining it and passing it with each call)?

Sure, move the linkage parameters to a working-storage area defined as
EXTERNAL GLOBAL.(I do this in PowerCOBOL all the time).

(Some platforms might even let you apply these descriptors to Linkage
items... I'm not sure and I can't be bothered looking it up, so stick them
in WS; I KNOW that works... :-)

Pete.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ / \ / ~ Live from Montgomery, AL! ~
~ / \/ o ~ ~
~ / /\ - | ~ daniel@thebelowdomain ~
~ _____ / \ | ~ http://www.djs-consulting.com ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w$ ~
~ !O M-- V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e ~
~ h---- r+++ z++++ ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

"Who is more irrational? A man who believes in a God he doesn't see, or a
man who's offended by a God he doesn't believe in?" - Brad Stine


.



Relevant Pages

  • Re: Linkage and Nested Subprograms
    ... some of the "main" programs LINKAGE SECTION items as being GLOBAL. ... END PROGRAM NESTED1. ... If I have a subprogram, that itself has nested subprograms, ... a man who's offended by a God he doesn't believe in?" ...
    (comp.lang.cobol)
  • Re: Linkage and Nested Subprograms
    ... If I have a subprogram, that itself has nested subprograms, ... only the "main" subprogram has the linkage section visible. ... display "in main program" ...
    (comp.lang.cobol)
  • Linkage and Nested Subprograms
    ... With this discussion about nested subprograms, there's something that's bugged me, but I'm not sure how to get around it. ... If I have a subprogram, that itself has nested subprograms, only the "main" subprogram has the linkage section visible. ... A man who believes in a God he doesn't see, or a man who's offended by a God he doesn't believe in?" ... - Brad Stine ...
    (comp.lang.cobol)
  • Re: Stop Run vs GoBack
    ... LINKAGE section *implies* that you are a subprogram, ... The LINKAGE section had some interesting variations. ... Division for our pseudo-conversational programs. ...
    (comp.lang.cobol)