subprogram was called dynamically or statically



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

subprogram was called dynamically or statically

Postby radha.krishna » Thu Mar 18, 2010 7:49 pm

By looking at the subprogram code ,how do u identify wether the subprogram was called dynamically or statically in main program.
radha.krishna
 
Posts: 9
Joined: Thu Nov 20, 2008 7:41 pm
Has thanked: 0 time
Been thanked: 0 time

Re: subprogram was called dynamically or statically

Postby Robert Sample » Thu Mar 18, 2010 8:03 pm

You cannot tell by looking at the subprogram code whether the subprogram was called dynamically or statically. You must look at the main program and its compile options to know for sure how the subprogram was called.
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: subprogram was called dynamically or statically

Postby radha.krishna » Thu Mar 18, 2010 8:08 pm

thanks for the reply......
radha.krishna
 
Posts: 9
Joined: Thu Nov 20, 2008 7:41 pm
Has thanked: 0 time
Been thanked: 0 time

Re: subprogram was called dynamically or statically

Postby Galbi » Sun Mar 21, 2010 7:02 pm

If the subroutine name is inside a working storage variable the call is dynamic.

If the name is directly used in the call command between the quote is static call.

Example

Working Storage section

…
01 Routine-Name Pic x(08) value ‘RoutineD’.
…

Procedure Division

…

Call Routine-Name Using … (this is a dynamic call) <<

Call ‘RoutineS’ Using … (this is a static call) <<

…

bye
Galbi
 
Posts: 5
Joined: Sun Mar 21, 2010 4:51 pm
Has thanked: 0 time
Been thanked: 0 time

Re: subprogram was called dynamically or statically

Postby dick scherrer » Sun Mar 21, 2010 9:15 pm

Hello,

If the name is directly used in the call command between the quote is static call.
Not correct.

This depends on the DYNAM/NODYNAM setting also. . .
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


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post