Thanks for the reply, and I am already familiar with the differences between BY
VALUE and BY REFERENCE. In my particular case all CALL parameters are BY
REFERENCE (by default, no BY phrases are used), and I expected the nested
COMMON subprogram to use the address passed in the call that
Of course in my last example,
compute N = 1066
move 'ty' to A
goback.
Should be
compute N = 1066
move 'ty' to X
goback.
--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu
The Linkage Section is how modules pass data from the top module in the chain
down, and then back. In fact, they don't "pass" the data at all, but use a
single address that is established by the top-most caller. All modules use the
same address which is located in the top-most module's DSECT,
In my specific case, there is a COPY structure populated in the outermost
program level that is passed in CALL statements to nested COMMON subprograms
(which can also CALL each other) and all the COMMON subprograms use the same
COPY structure to define their LINKAGE parameter. I just did not
I think the key is the use of GLOBAL variables: those available to all internal
subroutines. Not to be confused with EXTERNAL variables.
GLOBAL are available to all internal subroutines, as long as you don't redefine
the name in the subroutine. So if you want only one variable throughout,
Thanks for the reply Tom. I am of the opinion that the wording of that
paragraph is not clear enough. One extra sentence to make clear that the
CONTAINING program definitions take precedence over CONTAINED definitions of
the same name.
If I can find the time I can submit an RCF to that
>The V6.2 Language Reference Manual on page 60 says this about using identic=
>al names in nested programs:=20
>
>"Identical names
>When programs are directly or indirectly contained within other programs, e=
>ach program can use identical
>user-defined words to name resources.
>A program
Indeed, that was the issue, so thank you.
I still do not understand why the compiler requires that qualification in the
nested subroutine. It doesn't need it in the main (outermost) program, so why
in the subprogram? If I was the compiler writer I would use the "nearest"
definition (i.e.,
Oops, yes it is in the code snippet.
On Sat, Oct 9, 2021 at 2:22 PM Wayne Bickerdike wrote:
> It's not obvious from the code snippet. I agree with Mike Schwab, qualify
> the name. The duplicate could be in a COPY statement.
>
> On Sat, Oct 9, 2021 at 11:24 AM Mike Schwab
> wrote:
>
>> > 01
It's not obvious from the code snippet. I agree with Mike Schwab, qualify
the name. The duplicate could be in a COPY statement.
On Sat, Oct 9, 2021 at 11:24 AM Mike Schwab wrote:
> > 01 RECORD-NAME.
> > 05 SUBSECTION-NAME.
>
> > MOVE SUBSECTION-NAME TO WS-SUBSECTION-NAME.
>
> >
> 01 RECORD-NAME.
> 05 SUBSECTION-NAME.
> MOVE SUBSECTION-NAME TO WS-SUBSECTION-NAME.
> 25779 IGYPS0037-S "SUBSECTION-NAME" was not a uniquely defined name. The
> definition to be used could not be determined from the
> context. The reference to the name
This is an Enterprise COBOL V6.2 question. I am not sure if this is a compiler
issue or a programmer misunderstanding issue.
I have a COBOL subroutine which has multiple nested programs within it. The
general structure is as follows (it's actually far more complicated with COPY
members and
12 matches
Mail list logo