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



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

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

Postby pradeepgowda » Fri Apr 09, 2010 12:44 pm

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
pradeepgowda
 
Posts: 40
Joined: Mon Jan 04, 2010 4:17 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby GuyC » Fri Apr 09, 2010 5:08 pm

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
GuyC
 
Posts: 315
Joined: Tue Aug 11, 2009 3:23 pm
Has thanked: 1 time
Been thanked: 4 times

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

Postby pradeepgowda » Fri Apr 09, 2010 5:23 pm

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
pradeepgowda
 
Posts: 40
Joined: Mon Jan 04, 2010 4:17 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby Robert Sample » Fri Apr 09, 2010 5:32 pm

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)
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post