How can i tell if a module is being called dynam or static

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
mainframe5
Active Member
Posts: 59
Joined: Tue Jul 24, 2007 7:25 pm

How can i tell if a module is being called dynam or static

Post by mainframe5 » Wed Jan 09, 2008 7:29 pm

How can i tell if a module is being called dynamically or statically call please give example

User avatar
Krishna
Site Admin
Posts: 1052
Joined: Fri Jan 27, 2006 7:50 am

Post by Krishna » Thu Jan 10, 2008 2:14 pm

If program name is harcoded in CALL statement like CALL 'PROG1'. This is a static call. If program name passed from outside of the program and moved into a variable and used in the CALL statement, that is called dynamic statement.

Dynamic Call -

Move 'PROG1' TO WS-PROGRAM-NAME

CALL WS-PROGRAM-NAME



Other info -
In static linking, the called subroutine is link-edited into the calling program , while in dynamic linking, the subroutine & the main program will exist as separate load modules. You choose static/dynamic linking by choosing either the DYNAM or NODYNAM link edit option. (Even if you choose NODYNAM, a CALL identifier (as opposed to a CALL literal), will translate to a DYNAMIC call).

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others