View previous topic :: View next topic
|
Author |
Message |
manish84
New User
Joined: 11 Jan 2008 Posts: 1 Location: noida
|
|
|
|
Hi ALL,
I have these two copybooks defined in linkage section of my programs..
Copy Book...
.....................................................................................
01 F7010-ADHOC-EXTRACT.
.....................................................................................
01 F4720-VARCHAR-WORK-DG.
05 F4720-MOVE-AREA-LL PIC S9(4) COMP.
05 F4720-MOVE-AREA PIC X(30000).
.....................................................................................
Problem:
In Calling Program F870720 Copy Book (F7010-ADHOC-EXTRACT )being populated from Copy Book 110874720(F4720-MOVE-AREA).
Code is below in blue..
MOVE F4720-MOVE-AREA (1:F4720-MOVE-AREA-LL) TO
F7010-ADHOC-EXTRACT (9:F4720-MOVE-AREA-LL)
After this control returns back to Called program F870610,in this program there is no data in this DG 110877010(F7010-ADHOC-EXTRACT)but data is populating in program F870720.
These both Copy Books defined in Linkage Section of the two programs.
I am not able to find out what is the reason .
Please help me.
Thanks in Advance |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Jeez....
How are you establishing addressability to the data areas?
How in the calling program?
How in the called program? |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
manish84 wrote: |
Copy book for the both programs are same and I defined Copybook in the linkage section of both programs. |
yes, but how are you establishing addressability to the data areas?
How in the calling program?
How in the called program? |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Manish,
You only define the data areas in the CALLed pgm; you define the the "sending" data in WS of the CALLing pgm and use the CALL's USING clause to make them available to the CALLed pgm.
In the CALLed pgm use the USING clause in the PROCEDEURE DIVISION heading, pointing to the LS variable definitions.
E.g.:
Code: |
calling pgm code
WS
ws-copybook ....
PD
CALL subpgm USING cpybk fields
.
.
.
called pgm code
LS
ls-copy book....
PROCEDURE DIVISION USING ls-copybook fields
.
. |
|
|
Back to top |
|
|
|