Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts Restart=Step not working ALAK SAHA JCL & VSAM 6 Fri Jun 30, 2017 6:28 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us