Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

static and dynamic call in cobol

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

New User


Joined: 15 Oct 2005
Posts: 25

PostPosted: Fri Jan 27, 2006 6:42 pm    Post subject: static and dynamic call in cobol
Reply with quote

can anybody explain me about static n dynamic call with example
Back to top
View user's profile Send private message

DavidatK

Active Member


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

PostPosted: Sat Jan 28, 2006 1:12 am    Post subject: Re: static and dynamic call in cobol
Reply with quote

Tarunflash,

This subject has been addressed many times in the forums; if you do a search you will find much discussion on the subject.

In the most basic terms, a static call to a subroutine is when the subroutine has been included in the executable load module when you link edited it. This is done for a couple of reasons. One is efficiency; the operating system does not have to find and load the subroutine from the system libraries the first time you call it. This also makes you?re program more portable.

The downside of static calls is that if there is an updated version of the subroutine available you must re-link your program to pick it up.

Whereas, a dynamic call to a subroutine is where the subroutine is NOT included in the executable load module when you link edited it. The operating system must find and load the subroutine the first time you call it. This means that you can pick up any new versions of the subroutine without re-linking your program.

The downside of dynamic calls is that if there is an updated version of the subroutine available you will pick it up, and if there was a change in the subroutine that required you to modify your program you?re program will probably fail. And as the portability is an asset to a static call, it can be a deficit to a dynamic call because the subroutine must be in one of the system libraries and many times you are not 100% sure of the version that is being executed.

In our shop, we are making an effort to use dynamic calls, where updates and fixes to the subroutines are automatically picked up. As for not knowing the version of the subroutine running, we have incorporated a first time switch in the subroutines and display the compile date/time only the first time the subroutine is called.

When you call the subroutine it is generally considered a static call if the subroutine name is contained in quotes:

Code:


   CALL ?SUBR01? USING ....



And, if the subroutine name is contained in a variable it is generally considered to be dynamic.

Code:

   05 SUBROUTINE-NAME    PIC X(8)   VALUE ?SUBR01?.

   CALL SUBROUTINE-NAME USING ....



However, either of these can be overridden, You can specify in the compiler that ALL subroutine calls are to be dynamic, even if contained in quotes, and/or you can specifically include the subroutines in the load module at link edit time that makes them static calls.

If this is not clear, please let me know

Dave
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 XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us