COBOL/VSE Dynamic Calls to C/VSE Routines
LEzVSE 0600025UDN Visits (3779)
Prior to z/VSE 4.1, there were a number of restrictions that were imposed on any COBOL/VSE application that wanted to dynamically call another routine that had been compiled with the C/VSE compiler. Most of these restrictions were imposed due to the lack of write-able static support available within the LE/COBOL run-time. Essentially removing any chance of calling a C/VSE application that had not been written in a naturally-reentrant manner.
Natural re-entrancy is were the C/VSE program is designed and developed to maintain its own re-entrancy (eg not modify itself or static areas). Alternatively, constructed re-entrancy (eg the C/VSE program is compiled with the RENT option), is where the C/VSE application relies on the LE/C run-time (at execution time) to provide full re-entrancy. If a C/VSE application must be processed by the VSE pre-linker first then it is most likely using constructed re-entrancy.
With the introduction of the CEEFETCH and CEERELSE macros for LE-enabled HLASM programs, another option became available to allow the dynamic loading and then calling support for constructed re-entrant C/VSE programs.
To circumvent many of these restrictions for COBOL/VSE applications one method that could be used was to use an LE-conforming HLASM program that performed the 'dynamic call' using CEEFETCH on-behalf of the COBOL/VSE program.
In LE z/VSE 1.4.5 (z/VSE 4.1) some enhancements were made to the LE/COBOL run-time so as to provide improved support for dynamic C/VSE application calls where those C/VSE programs require support for constructed re-entrancy. This change means that COBOL/VSE programs that want to dynamically call a C/VSE application that uses constructed re-entrancy can now call that C/VSE routine directly.
There are still some requirements that need to be met (for example, the C/VSE routine cannot be a 'main' and it must be defined as 'fetchable') but they are a lot less than previously. The documentation for this dynamic call support can be found in the "LE z/VSE Writting ILC Applications" manual.