Joined: 06 Jun 2008 Posts: 8214 Location: Dubuque, Iowa, USA
You have a very basic, fundamental misunderstanding of COBOL. A copybook is source code that is called into the program when it is compiled. There is, therefore, absolutely no way a copybook can be involved in a run-time CALL to another program. When the call occurs, the copybook has long been copied into the code as part of the compile process. The copybook will not be used at run time for anything.
Accordingly, making statements like
PROGA is calling PROGB using copybook COPY1
PROGB is calling PROGC using copybook COPY1.
is complete nonsense -- and cannot occur under any circumstances whatsoever. Variables may be passed from program to program, but they are not copy books at that point -- they are variables in the program and could not be distinguished from a variable defined without a copybook.
You may be calling a program using data included from a copy book but you cannot call a program using a copy book.
So, given from your problem statement that you have no clue about what is going on, try this: what variables are involved in the call from PROGA to PROGB? and what variables are involved in the call from PROGB to PROGC? are the calls COBOL CALL statements, EXEC CICS LINK statements, or something else -- and if so, what? What does the PROCEDURE DIVISION USING look like for PROGB and PROGC?
Joined: 18 Jul 2007 Posts: 2150 Location: At my coffee table
I assume that:
PROGA has the 01 COPY1 in working storage,
PROGB has the 01 COPY1 in linkage section,
PROGC has the 01 COPY1 in linkage section
there is no RETURN done in PROGB prior to the CALL to PROGC.
The obvious problem is that you have lost addressability to PROGC's COPY1.
Try to display the address of PROGB's COPY1 at the start of the program and just before the call to PROGC.