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
 
How does the LINKER program locates the sub-program

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

New User


Joined: 21 Sep 2005
Posts: 79
Location: India

PostPosted: Thu Oct 06, 2005 12:31 pm    Post subject: How does the LINKER program locates the sub-program
Reply with quote

Question:When we compile and link a Cobol program, how does the LINKER program locates the sub-program (Called program) to be linked? By the PROGRAM-ID of the called program or by the member name (dsname) of the LOADLIB PDS.

For example the program that we are compiling contains this statement:

CALL 'ABC'.

Case 1:
Now if 'ABC' is the PROGRAM-ID of the program to be called, than how actually the LINKER program willl locate the sub-program to be linked. Where will it search for?

Case 2:
if 'A' has to be the member name in the LOADLIB PDS, then what is the use of PROGRAM-ID?

More:
That too how the same works in case of static and dynamic linking?

Please feel free to clarify the complete picture.
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: Fri Oct 07, 2005 7:11 pm    Post subject:
Reply with quote

Hi,
PROGRAM_ID entry of subprogram is for source code referenceses.Once subprogam is compiled, object program is it's identity,ie.,the member name of it's object code.This holds good for both static and dynamic call. Note:Source member name can be different from object code's member name,this can be done by JCL.In case of static call,while linkeditting the subprogram's object member name is searched for in the given PDS.
Hope this helps...
Sridevi.
Back to top
View user's profile Send private message
umeshkmrsh

New User


Joined: 21 Sep 2005
Posts: 79
Location: India

PostPosted: Sat Oct 08, 2005 3:01 pm    Post subject:
Reply with quote

Thanks Sridevi,

This makes things clear. I am just listing point the outcome of the discussion below. Correct if required.

(1) Once compiled dsname (load lib member name) acts as the programs identity. This applies in case is static and dynamic linking. Program-Id dosent plays any role in this case.
(2) If the called programs is a built-in program (written within the calling program), as possible in case of COBOL-85. In such case program-id of subprograms acts as its identity.
(3) Source code and the object code of a program can have different dsnames.

Note: I have used dsname in this coversation which is actually the member name of a PDS (loadlib or sourcelib).
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: Sat Oct 08, 2005 9:06 pm    Post subject: Re: How does the LINKER program locates the sub-program
Reply with quote

Hi umeshkmrsh,
Yep, you are correct,as per my knowledge.
Sridevi.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Oct 08, 2005 9:58 pm    Post subject:
Reply with quote

If you have access to a MF you can test this by linking the pgm w/a different member name than the pgm-id.

Then exec/call the pgm using either name to see what happens.
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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Compiling program in endeavor for tra... RALAKKAL Compuware & Other Tools 4 Mon Jun 05, 2017 8:27 pm

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