Dynamic/static call



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

Dynamic/static call

Postby maxcc » Sat Jul 10, 2010 12:17 am

How can we find out in a program if it is a dynamic/static call apart from dynam/no dynam option?
maxcc
 
Posts: 28
Joined: Fri Apr 30, 2010 12:50 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Dynamic/static call

Postby Robert Sample » Sun Jul 11, 2010 8:34 pm

The best way is to look at the load module using AMBLIST or whatever similar tool your site uses to see if the called program is linked into the load module.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Dynamic/static call

Postby nm992 » Sun Jul 11, 2010 11:49 pm

The static form of the CALL statement specifies the name of the subroutine as a literal; e.g., it is in quotes.



The dynamic form of the CALL statement specifies the name of the subroutine using a variable; the variable contains the name of the subroutine to be invoked


Plz revert if you need more info.
nm992
 
Posts: 43
Joined: Sun Jul 11, 2010 11:31 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Dynamic/static call

Postby dick scherrer » Mon Jul 12, 2010 12:55 am

Hello,

While that is somewhat true, the best way to see how a module is invoked is using AMBLIST as Robert suggested. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Dynamic/static call

Postby Robert Sample » Mon Jul 12, 2010 3:37 am

The static form of the CALL statement specifies the name of the subroutine as a literal; e.g., it is in quotes.
Your statement is not true all the time. From the COBOL Programming Guide manual:
2.4.20 DYNAM

Use DYNAM to cause nonnested, separately compiled programs invoked through the CALL literal statement to be loaded for CALL, and deleted for CANCEL, dynamically at run time. (CALL identifier statements always result in a runtime load of the target program and are not affected by this option.)
So a statement in the form of CALL 'ABCDEFGH' may be static OR dynamic, depending upon the compiler options used.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Dynamic/static call

Postby maxcc » Mon Jul 19, 2010 6:50 pm

Thanks for the replies.
maxcc
 
Posts: 28
Joined: Fri Apr 30, 2010 12:50 pm
Has thanked: 0 time
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post