IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Facing problem due to Linkage section....


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manish84

New User


Joined: 11 Jan 2008
Posts: 1
Location: noida

PostPosted: Sat Jan 19, 2008 1:53 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Sat Jan 19, 2008 4:26 pm
Reply with quote

Jeez....

How are you establishing addressability to the data areas?
How in the calling program?
How in the called program?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Sat Jan 19, 2008 5:40 pm
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Jan 19, 2008 9:08 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts Facing ABM3 issue! CICS 3
No new posts z/vm installation problem All Other Mainframe Topics 0
Search our Forums:

Back to Top