View previous topic :: View next topic
|
Author |
Message |
Debasis Misra Warnings : 1 New User
Joined: 16 Sep 2008 Posts: 72 Location: Bangalore
|
|
|
|
I am having a requirement like this:
PROGA is calling PROGB using copybook COPY1
PROGB is calling PROGC using copybook COPY1.
All programs are CICS program.
In the copybook COPY1, some of the request fields are populated by PROGA and some by PROGB, so using same copybook for both of the call.
But while trying to access any variable of that copybook in PROGC, getting S0C1 abend.
Can anyone suggest how to use the same copybook in more than one call under same transaction. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 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
Quote: |
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? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Can anyone suggest how to use the same copybook in more than one call under same transaction. |
As copybooks are usually used in multiple programs, suggest you look at some other programs that use this copybook or at some other copybook that is used by multiple programs. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 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. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
The copybook can be defined as EXTERNAL, which makes it addressable in all sub-program's within the run-unit and without having to pass it as a parm.
Bill |
|
Back to top |
|
|
|