Page 1 of 1
static or dynamic CALL in COBOL.
Posted: Tue Jun 04, 2024 9:54 am
by Vibha
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 ?
Re: static or dynamic CALL in COBOL.
Posted: Tue Jun 04, 2024 6:19 pm
by Robert Sample
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.
Re: static or dynamic CALL in COBOL.
Posted: Tue Jun 04, 2024 10:48 pm
by Vibha
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?