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

Moving working storage section data to Linkage section data


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

New User


Joined: 21 Oct 2003
Posts: 45

PostPosted: Wed Oct 19, 2005 6:31 pm
Reply with quote

One doubt regarding Linkage section. Can we move working storage section data to Linkage section data. If posible how can we code the program.
Back to top
View user's profile Send private message
Sridevi_C

Active User


Joined: 22 Sep 2005
Posts: 104
Location: Concord, New Hampshire, USA.

PostPosted: Wed Oct 19, 2005 8:49 pm
Reply with quote

Main program's working storage section variable's contents are moved to the sub program's linkage section variables(ie.,parameter passing using CALL). Linkage section can also get value through PARM parameter.
Main pgm:
WORKING-STORAGE SECTION.
77 A PIC 9 VALUE 9.
77 B PIC 9 VALUE 8.
77 C PIC 99.
PROCEDURE DIVISION.
PARA.
....
CALL SUB USING A,B,C.
DISPLAY C.
.....
Sub pgm:
LINKAGE SECTION.
77 X PIC 9.
77 Y PIC 9.
77 Z PIC 99.
PROCEDURE DIVISION USING X,Y,Z.
....
COMPUTE Z = X - Y.
.....
output:1
Also if the sub pgm has working storage variables by itself then those values can be moved to it's own linkage section variables (though automatically it receives value from the calling pgm)during calculation.
I hope it doesn't confuse...
Regards,
Sridevi
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 How to save SYSLOG as text data via P... All Other Mainframe Topics 2
No new posts Store the data for fixed length COBOL Programming 1
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
Search our Forums:

Back to Top