Give simple program example for Dynamic link and Dynamic call in COBOL?

Questions by gilbat82   answers by gilbat82

Showing Answers 1 - 12 of 12 Answers

Rachell

  • Jul 21st, 2009
 

Static Call In Cobol:


Is calling of a literal.

CALL 'ABC' USING ARGUMENTS

The call statement specifies the sub-routine called as a literal. i.e, within quotes 'ABC'.
In static calls, if ABC is modified and recompiled, then all the executables calling ABC should be relinked.

Dynamic Calls:

01 Sub-Routine pic x(8) value 'ABC'

CALL ABC USING ARGUMENTS

Dynamic calling invovles calling a sub-routine using a variable and the variable contains the sub-routine name.
here the complied code is loaded when needed and is not incorporated into the executable.

kmdeepu

  • Aug 23rd, 2009
 

Usually in COBOL the subroutines are compiled and linked to the load module at the time of compilation and if we are calling the subroutine only a few times, then may not worth keeping in the memory unnecessary. This is known as STATIC CALL. So COBOL facilitates another mechanism called DYNAMIC CALLs to avoid this prob. In dyanamic call, the subroutine is not a component of the main program. It is compiled separately and is only moved to main memory at the time of CALLing. Hence it saves memory and overhead.

If the main module is calling submodule statically then the sub module's code will be copied into the main module in the comiled version but this wont happens in DYNAMIC calls case.

Hope it will help.
Regards,
Ambadi. Ramesh.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions