HOW TO FIND LINKAGE LENGTH

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
Rasika Shetty
Member
Posts: 1
Joined: Wed Jul 16, 2014 11:11 am

HOW TO FIND LINKAGE LENGTH

Post by Rasika Shetty » Wed Jul 16, 2014 11:17 am

HI,
If a program eg C1 is called by main program M1 & M2 then. how do we find its linkage length.. ? is there any way to find the linkage length and the length of each variables used in that linkage section. I tried using AMBLIST but didnt get the solution..

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Wed Jul 16, 2014 11:46 am

I think you need to read a description of AMBLIST so that you can understand that you may as well have read a food-packaging label. I don't know how you came up with that idea, but it should have been very short-lived.

The answer to your question is 1) it cannot be determined 2) because of 1) we always code so that we know the length.

dhiraj
Member
Posts: 48
Joined: Tue May 06, 2014 11:22 am

Post by dhiraj » Thu Jul 24, 2014 2:41 pm

If you can not calculate then you can Use FileAid to know the layout length and each variable length.
Thanks,
--Dhiraj Mishra

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Thu Sep 04, 2014 3:31 pm

FileAid? To know the "length" of an item in the LINKAGE SECTION? How is that going to work? Still, you got two votes for it, so where does reality need to impinge? :-)

chaat
Member
Posts: 20
Joined: Sun Apr 18, 2010 11:51 pm
Location: St. Cloud, Minnesota, USA

Post by chaat » Mon Sep 08, 2014 5:46 am

Dhiraj,

the most common practice in most shops is to require that all areas that are used to communicate between programs must be in copy members that are used by both the calling and called programs. This is a tried and true method of ensuring that length in the linkage section of the called program matches the length of the actual storage in the calling program.

The default method of calling programs in COBOL is CALL BY REFERENCE. "BY REFERENCE" means that only the address of the variable is passed to the called program. So all that the called program has available to it is the ADDRESS of the variable. It is imperative that the programmer ensures that the linkage definition of that variable match the definition in the calling program.

There are exceptions to these general guidelines. but deeper understanding is required before venturing in that situation.
Chuck Haatvedt

email --> clastnameatcharterdotnet

(replace lastname, at, dot with appropriate
characters)

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others