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

USAGE of Static call & dynamic Call.


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

New User


Joined: 22 Jun 2005
Posts: 65
Location: Mumbai

PostPosted: Tue Oct 31, 2006 4:05 pm
Reply with quote

I would like to understand When do we use Static Call & In which condition we should use Dynamic call.

Can someone please explain me Why & when we should use dynamic call or Static call?

Thanks in advance.
Nilesh P.
Back to top
View user's profile Send private message
sbpati

New User


Joined: 11 Oct 2006
Posts: 11

PostPosted: Tue Oct 31, 2006 4:53 pm
Reply with quote

Hi,

Please refer the earlier answer with subject
When to use Static and Dynamic Call ?

Let me know still u have any doubts.

sbpati
Back to top
View user's profile Send private message
nileshyp

New User


Joined: 22 Jun 2005
Posts: 65
Location: Mumbai

PostPosted: Tue Oct 31, 2006 6:06 pm
Reply with quote

I would appreciate if you could explain me again.

Thanks,
Nilesh P.
Back to top
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Tue Oct 31, 2006 6:26 pm
Reply with quote

Hi Nilesh,

For Batch programs we can use Dynamic, static calls. Static call is advisable when less storage is needed i.e., subprogram is called few times. Otherwise use Dynamic call.

Dynamic called program will be loaded into storage when it is called where static called program will be loaded regardless of when it is called.

I am not sure, but I heard, Online Programs (CICS) will prefere only static call.
Back to top
View user's profile Send private message
viv
Currently Banned

New User


Joined: 31 Oct 2006
Posts: 4

PostPosted: Tue Oct 31, 2006 6:45 pm
Reply with quote

dude check out this link
http://www.screenio.com/tips/calls.htm
Back to top
View user's profile Send private message
shreevamsi

Active User


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

PostPosted: Tue Oct 31, 2006 6:58 pm
Reply with quote

The main difference between static and dynamic call is the time at which the load module of a subroutine gets invoked or gets attached to the load module of its main program. To get a better picture, let us take an example.

Let A be the Main Program, and this main program invokes the subroutines X, Y and Z. We would have coded the modules X, Y, Z and would have compiled it before executing A.


Static Call:

Now, a static call to the modules X, Y and Z means attaching the load modules of X, Y, Z to the load module of A. It?s like creating a single pack which contains all the load modules needed to execute a higher level program which calls many other programs. This can be done by specifying the compiler option "NODYAM" while compiling the program.

All the load modules of sub routines are embedded within the load module of the main progam.


Dynamic Call:

A dynamic call to the modules X,Y and Z means that you will not attach the load modules of X,Y, Z to the load module of A. The load modules of X,Y and Z will lie in a separate library and the load module of A will lie in a separate library. You will just refer to the library in which the load modules of X,Y and Z lie, while executing the program A. So when ever the subroutines X or Y or Z are invoked in the program A, the library which is specified will be searched for the load modules. By mistake, if the library of the subroutine does not contain the referred program, the system standard library will be searched. If the program is not found in standard library too, the programs will abend. This can be done by specifying the compiler option "DYNAM" while compiling the program.

Performance Comparison of Static Call and Dynamic Call:
Both Static call and Dynamic Call are advantageous depending on various parameters.
1) If your subroutines involve frequent changes, then static call will be a burden. Since the load module of the subroutine is embedded inside the load module of the main program, when ever you recompile the subroutine, you should relink(Process of replacing the old load module with new one) the main program. This surely will be a burden.
In dynamic call, it?s enough if you recompile the sub-routine and put it in the specified library. The new load module will be invoked automatically from the library specified.
2) On the other hand, statically called programs take less time to execute. The overload of searching the library and then invoking the required load is not present in case of static calls.
So, depending on our application need both static calls and dynamic calls are advantageous.

Correct me if i am wrong.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Oct 31, 2006 10:27 pm
Reply with quote

The exaggeration of time required to LOAD dynamically linked modules has caused many shops to stay with the MF-DOS mentality of statically linked modules. With RUN-UNITs of short duration, one can see an extra nanosecond or two, but with long running programs, this 'OVERHEAD' is obviated thru the ease of maintainance. Change a module in a dynamically linked environment, you only have to compile and relink the module in question, without the 'OVERHEAD' of relinking the complete RUN-UNIT. Plus, you never really know what module will be CALLed in a static environment - depends on when the RUN-UNIT was last linked.

You do not have to make your sub-modules into DLL's. Though that hyperlink provided by viv was very informative, it stressed the DLL and made little or no mention of simple dynamic COBOL CALLs. Code a CALL with a reference (containing the CALLed modules name) instead of hardcoding the module name in the CALL and you are sure of a dynamic CALL. Sub-modules are linked as dynamic (link and compile parms).

I have consulted to more than 20 shops since the 1980's, which was the last time I dealt with the MF-DOS statically linked RUN-UNIT convention.

With the availability of the COBOL CALL from within a CICS module, statically linking the COBOL portion of the load unit is not advised. I have been part of projects that wrote the business logic with dynamically CALLed COBOL modules (from CICS modules that performed the front end - msging, screen processing, etc..). The business logic entailed 1000+ modules, which could be used - without change - by batch drivers.

If possible, I would stay away from static CALL design.
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 Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts JCL Dynamic System Symbols JCL & VSAM 3
No new posts Call program, directly from panel CLIST & REXX 9
No new posts Synctool-dynamic split job for varyin... JCL & VSAM 7
Search our Forums:

Back to Top