static or dynamic CALL in COBOL.

All sort of Mainframes Interview Questions.
Post Reply
Vibha
Registered Member
Posts: 44
Joined: Tue Jul 16, 2013 7:35 pm
India

static or dynamic CALL in COBOL.

Post 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 ?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1903
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: static or dynamic CALL in COBOL.

Post 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.
Vibha
Registered Member
Posts: 44
Joined: Tue Jul 16, 2013 7:35 pm
India

Re: static or dynamic CALL in COBOL.

Post 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?
Post Reply

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

Register

Sign in

Return to “Interview Questions.”