IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DYNAMIC and STATIC Linking in COBOL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
syntelraj
Warnings : 1

New User


Joined: 28 Jul 2006
Posts: 10
Location: Pune

PostPosted: Thu Aug 03, 2006 2:50 pm
Reply with quote

Can any one explain the following scenario falls under STATIC or DYNAMIC linking?

Calling program has the below statment and at the time of linking NODYNAM option was used.

CALL WS-SUB-PROGRAM USING WS-VAR1

I just want to know what happens in this case.

Thank you very much for your time.
Back to top
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Thu Aug 03, 2006 3:03 pm
Reply with quote

When a program that is compiled using the NODYNAM and NODLL compiler options, a static call occurs.

~Vamsi
Back to top
View user's profile Send private message
syntelraj
Warnings : 1

New User


Joined: 28 Jul 2006
Posts: 10
Location: Pune

PostPosted: Thu Aug 03, 2006 5:42 pm
Reply with quote

Thanks for your response Vamsi.

In this case what will be the value in the variable WS-SUB-PROGRAM?

I think there will be no memory is allocated to this variable at the compile time.

Do you mean the whatever value we initialze in the working storage the same will be used??

If we don't assign any value to WS-SUB-PROGRAM, does it cause any compilation ( I actually mean link) error?

Do you mean only during linking time the CALL type will be decided?

Even though all the questions similar, I want to make each and every point clear.

Could some please provide answers for each question.

Thank you very much for your time & patience.
Back to top
View user's profile Send private message
DavidatK

Active Member


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

PostPosted: Fri Aug 04, 2006 4:49 am
Reply with quote

Hi syntelraj,

The DYNAM/ NODYNAM compiler option only affects subroutine call in this format:

CALL 'MYSUB' USING ARG1.

If the NODYNAM option has been used, then the call is STATIC, If the DYNAM option was used the call is DYNAMIC.

Subroutine calls in this format:

CALL WS-SUB-PROGRAM USING WS-VAR1.

Are ALWAYS DYNAMIC calls.

Dave
Back to top
View user's profile Send private message
syntelraj
Warnings : 1

New User


Joined: 28 Jul 2006
Posts: 10
Location: Pune

PostPosted: Fri Aug 04, 2006 9:24 pm
Reply with quote

Thank you very much Dave for the clarification.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top