Hello,
I have a question I have a sub program which I'm calling n number of times in my main COBOL program which call is better static or dynamic and why ?
static or dynamic CALL in COBOL.
- Robert Sample
- Global Moderator
- Posts: 1903
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: static or dynamic CALL in COBOL.
Your question makes as much sense as asking "how high is up?" "Better" can be defined in different ways (such as lowest memory used, fastest execution time, easiest to modify, etc.) and hence the answer to your question will depend upon what you're wanting to optimize.
In general, dynamic calls will create smaller load modules but take slightly longer to execute since the subprogram has to be loaded from disk (this may be a one-time thing or every time the subprogram is called, depending upon the options used). But if the subprogram is changed often, dynamic makes updates easier since for static calls, the calling program has to be recompiled every time the subprogram changes.
In general, dynamic calls will create smaller load modules but take slightly longer to execute since the subprogram has to be loaded from disk (this may be a one-time thing or every time the subprogram is called, depending upon the options used). But if the subprogram is changed often, dynamic makes updates easier since for static calls, the calling program has to be recompiled every time the subprogram changes.
Re: static or dynamic CALL in COBOL.
Thanks, I can understand that but Can FUNCTIONS like other language be used in COBOL. I mean it gets confusing even today that we think about calling a program in memory?
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute