The differences between CALL, LINK, LOAD and XCTL.
CALL |
This macro is common to both Static Linkage and Dynamic Linkage with its function being to pass control to a sub-routine from which a return is
expected. To work successfully in Dynamic Linkage mode however, a LOAD macro is required to place a copy of the sub-routine in memory, prior to
issuing the CALL. If the sub-routine is not located within the load module an S0Cx Abend will occur. |
LINK |
Like CALL this also passes control to separate sub-routine from which a return is expected. In this instance the sub-routine will exist as a
separate entity in either the same load library as the caller or in a different library accessible to the job step executing the calling program. If the sub-routine is not found, an S806 Abend will occur. |
LOAD | This macro merely loads a module into memory it does not pass control to the it. The macro returns the load address of the requested module and
that address can be used instead of the module name with the other macros such as CALL, LINK, and XCTL. When combined with CALL, this macro can be used to simulate COBOL dynamic CALL, and PLI FETCH functionality. |
XCTL | Like LINK, this passes control to a separate module from which a return is not expected. The module will exist as a separate entity in either the same load library as the caller or in a different library, and if the module is not found an S806 Abend will occur. |