Page 1 of 1

subprogram was called dynamically or statically

PostPosted: Thu Mar 18, 2010 7:49 pm
by radha.krishna
By looking at the subprogram code ,how do u identify wether the subprogram was called dynamically or statically in main program.

Re: subprogram was called dynamically or statically

PostPosted: Thu Mar 18, 2010 8:03 pm
by Robert Sample
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.

Re: subprogram was called dynamically or statically

PostPosted: Thu Mar 18, 2010 8:08 pm
by radha.krishna
thanks for the reply......

Re: subprogram was called dynamically or statically

PostPosted: Sun Mar 21, 2010 7:02 pm
by Galbi
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

Re: subprogram was called dynamically or statically

PostPosted: Sun Mar 21, 2010 9:15 pm
by dick scherrer
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. . .