MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Static and Dynamic Call difference

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
abracadabra
Beginner


Joined: 02 Sep 2003
Posts: 101
Topics: 55
Location: India

PostPosted: Sat Jan 03, 2004 12:29 am    Post subject: Static and Dynamic Call difference Reply with quote

Hi,

In static call, the program name is hard coded and while compiling the main program , the sub program load module should be specified whereas in dynamic call, the program is not hard coded but made up in the program. Moreover, the load module of the sub program is picked up at run time. The compilation parameter by default i believe is nodynam.

Moreover, if i make a change in the sub program, for static call the main program has to be compiled again while it is not the case for dynamic call.

Is there any other difference between the two? Also how is the sub program picked at run time during dynamic call?

Thanks
_________________
Cheers!
Back to top
View user's profile Send private message
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Sat Jan 03, 2004 11:17 pm    Post subject: Reply with quote

Hi abcd,

Here's the skinny on how a static/dynam call is determined:

If compiled as NODYNAM:
CALL 'literal' is a static call
CALL WS-label is a dynamic call

If compiled as DYNAM:
CALL 'literal' is a dynamic call
CALL WS-label is a dynamic call

You're right about subpgm updates.

One advantage of a static CALL is that it only sets the param list and the return address, loads register 15 and branches to the address in reg15 (the EP of the subpgm). A dynam CALL requires the assistance of a system module to select and search the JOB/STEP libs and load/exec the subpgm.

There are other differences about how data in WS is retained (or not) depending on your choices and the options available. I'll leave that research up to you.

To find a dynamically called pgm the system (don't know the module name) searches the directories of any JOB/STEP libs (implicit or explicit) for the module used in the CALL stmt and loads/executes the subpgm.

Regards, Jack.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Sun Jan 04, 2004 11:50 am    Post subject: Reply with quote

abracadabra,

Please search before posting. This topic had already been discussed. check this topic which discusses the differences between static and dynamic calls.

http://www.mvsforums.com/helpboards/viewtopic.php?t=753

Hope this helps...

cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group