Page 1 of 1

how to decide to go for a static call or dynamic call

PostPosted: Fri Apr 09, 2010 12:44 pm
by pradeepgowda
Hi,

On what basis should we decide to go for a static call or dynamic call in cobol. how should i decide.
it has been asked in two interviews please give me the ansewrs

Re: how to decide to go for a static call or dynamic call

PostPosted: Fri Apr 09, 2010 5:08 pm
by GuyC
Static Calls :
-) if subroutine is changed , then all programs static calling that subroutine have to be re-linked (recompiled) <=== most important
-) you loadmodules are bigger : thus each program with subroutines need more memory
+) faster

Re: how to decide to go for a static call or dynamic call

PostPosted: Fri Apr 09, 2010 5:23 pm
by pradeepgowda
But on what conditions should i decide to go for a static call or dynamic call. on what scenarios i should choose static call or dynamic call

Re: how to decide to go for a static call or dynamic call

PostPosted: Fri Apr 09, 2010 5:32 pm
by Robert Sample
Is the subroutine going to be used by multiple calling programs? Dynamic call would be better; otherwise, static.

Does the subroutine need to start with the same initial data every time? Dynamic with CANCEL would be the way to go; otherwise, static.

What are the site standards?

There are not really a whole lot of hard and fast rules about when to use dynamic or static calls -- a lot depends upon the programmer's experience level, the site standards, and the application requirements. The COBOL Programming Guide does list the restrictions on when you cannot use dynamic calls:
Restrictions: You cannot make dynamic calls to:

* COBOL DLL programs

* COBOL programs compiled with the PGMNAME(LONGMIXED) option, unless the program-name is less than or equal to eight characters in length and is all uppercase

* COBOL programs compiled with the PGMNAME(LONGUPPER) option, unless the program-name is less than or equal to eight characters in length

* More than one entry point in the same COBOL program (unless an intervening CANCEL statement was executed)