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
 

 

regarding variables in linkage section.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
mfjude

New User


Joined: 09 Jan 2006
Posts: 20

PostPosted: Fri Feb 17, 2006 12:30 pm    Post subject: regarding variables in linkage section.
Reply with quote

I am analysing some client code.He has inserted variables in the linkage section but is not using them as parameters in procedure division using clause....Can these variables be used as simple working-storage variables now ?
Back to top
View user's profile Send private message

smiley
Warnings : 1

New User


Joined: 08 Feb 2006
Posts: 27

PostPosted: Fri Feb 17, 2006 2:49 pm    Post subject:
Reply with quote

Quote:
I am analysing some client code.He has inserted variables in the linkage section but is not using them as parameters in procedure division using clause....Can these variables be used as simple working-storage variables now ?


Hi jude,

can u pls explain??
is that variables not at all used in the program?
Back to top
View user's profile Send private message
mfjude

New User


Joined: 09 Jan 2006
Posts: 20

PostPosted: Fri Feb 17, 2006 3:25 pm    Post subject: Re: regarding variables in linkage section.
Reply with quote

no the variable is used in the pgm.....it is assigned some address in the pgm ? icon_sad.gif
Back to top
View user's profile Send private message
smiley
Warnings : 1

New User


Joined: 08 Feb 2006
Posts: 27

PostPosted: Fri Feb 17, 2006 3:54 pm    Post subject:
Reply with quote

To my knowledge we used to declare a variable in LINKAGE section if we are using it to recieve/pass values from/to other programs.




Correct me if I am wrong!!
Back to top
View user's profile Send private message
small_world

New User


Joined: 22 Jul 2005
Posts: 24
Location: pune

PostPosted: Fri Feb 17, 2006 4:07 pm    Post subject:
Reply with quote

hi jude,
to my knowledge we cant use a variable declared in linkage section as working storage variables.

icon_confused.gif
Back to top
View user's profile Send private message
small_world

New User


Joined: 22 Jul 2005
Posts: 24
Location: pune

PostPosted: Fri Feb 17, 2006 4:08 pm    Post subject:
Reply with quote

what smiley said is right!!!! its only used to pass the values from other programs...
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Sat Feb 18, 2006 1:30 am    Post subject: Re: regarding variables in linkage section.
Reply with quote

Mfjude,

The variables in LINKAGE SECTION can be used as simple working storage under some conditions.

The most common use of the linkage section is to pass data from the calling and called programs. We are all familiar with that and require the PROCEDURE DIVISION USING reference.

It can also be used to receive parameters from the ?PARM=? on the jcl EXEC card. This is very similar to passing data from another program, in this case from the operating system, and also require the PROCEDURE DIVISION USING reference.


There is however, another way to use the LINKAGE SECTION that does not involve passing data from another program that does NOT require the PROCEDURE DIVISION USING reference.

If you have a subroutine that does a ?GETMAIN?, you can set the ?ADDRESS OF? linkage section variable to the address of the ?GETMAIN?d storage and then use that area as you would any other working storage. One reason for doing this would be to make the program reentrant, where the program/subroutine can call itself and still keep the working storage unique.

This also might be done if the program requires occasional storage for large tables. Or for whatever reason the programmer requires this type of storage.

It can also be used to access operating system tables/variables if you know the offsets.

So, in conclusion, you can have variables in the LINKAGE SECTION that are not declared in the PROCEDURE DIVISION USING and be legitimate.

Dave,
Back to top
View user's profile Send private message
mfjude

New User


Joined: 09 Jan 2006
Posts: 20

PostPosted: Tue Feb 21, 2006 7:56 pm    Post subject: reply
Reply with quote

thanks.....it was really knowledgable
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 DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:21 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts Is it possible to pass variables of s... Csongor CLIST & REXX 2 Fri Jun 10, 2016 7:33 pm


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