Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Moving working storage section data to Linkage section data

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Moving working storage section data to Linkage section data
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 0 Tue Sep 26, 2017 3:35 am
No new posts LIBDEF not working in called proc packerm CLIST & REXX 0 Fri Sep 15, 2017 7:22 pm
No new posts Working with hex values in Filemanage... Emile Straker IBM Tools 0 Tue Sep 12, 2017 1:42 am
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us