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 RULES(NOEVENPACK) in cobol jackzhang75 COBOL Programming 5 Wed Mar 29, 2017 12:47 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm


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