What is Linkage Section? Can we use this concept when there's no called program?

Questions by Suganj   answers by Suganj

Showing Answers 1 - 21 of 21 Answers

kaHackett

  • Apr 28th, 2007
 

The linkage section is a way to obtain address to storage areas outside your program. Typically we think the data passed by a main/calling program. But the Linkage Section can also be used to access PARM data from JCL or in CICS/DB2 to access "system" information. (Keeping in mind these programs are really subprograms to CICS and /or DB2).  Finally you could be passed an address by another routine (i.e. a called C or C++ function) and then use COBOL's SET POINTER to reference the storage at the passed address.

  Was this answer useful?  Yes

Hi,
   Thanx for your answer. but i am little bit confused. Actually linkage section is nothing but when we use same variables in both the called and calling program.Is it right? If it right tell me can i use this concept without any sub program or called  program? pls help me out......

  Was this answer useful?  Yes

Rajni

  • May 25th, 2007
 

How can you use the concept of Linkage section in the manner you have specified.. Where do you intend to populate these values from and where do you intend to send the values back? It is not possible in the manner you are expecting. Linkage section is designed for passing values from different sources, it cannot be within the same source.

  Was this answer useful?  Yes

vidhya

  • May 10th, 2013
 

When there is PARM passed from JCL, we need Linkage Section in COBOL program even when there is no called program.

  Was this answer useful?  Yes

You can certainly declare the variables in Linkage section even if you are not using them to call any external program. it wont result in error, but anyhow they wont get populated unless u receive data into them or populate them yourself to pass data to some called program.

I hope this helps !!!

Pradeep CR

  • Aug 28th, 2014
 

Linkage basically used for to receive date, that is external to the program. So you can able to send the data to the processing program by JCL through PARM parameter. For this you have to declare 2bytes binary variable along with actual data. Second thing, if you are receiving the data to sub program from main program that time also we will declare variables in linkage section. So make sure that even we are declared in linkage section but not used means it will through any compiler error.

  Was this answer useful?  Yes

ajayreddy

  • Nov 17th, 2014
 

When program designed to receive data from jcl or from other programs appropriate data items should be defined in this linkage section.

Through the data items defines in this section,program will get the data from the other programs or from the jobs.The linkage section defined under the DATA DIVISION.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions