Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
![]() Determining the main routine z/OS Language Environment Writing Interlanguage Communication Applications SA38-0684-00 |
|||||||||||||||||||
In Language Environment, only one routine can be the main routine; no other routine in the enclave can use syntax that indicates it is main. If you write the main routine in C, you must use language syntax to identify the routine as the main routine. If you use COBOL as the first program in the enclave that is to gain control, the program is effectively designated main by being the first to run. In C, the same routine can serve as both the main routine and subroutines if recursively called. In such a case, the new invocation of the routine is not considered a second main routine within the enclave, but a subroutine. With a VS COBOL II or COBOL/370 single enclave, a recursively called main program is not permitted; Enterprise COBOL for z/OS, COBOL for OS/390 & VM and COBOL for MVS & VM support recursion. Table 1 describes how C and COBOL identify the main routine.
An entry point is defined for each supported HLL. Table 2 identifies the desired entry point. The table assumes that your code was compiled using the Language Environment-conforming compilers.
Note: Specify ENTRY statement on link for the function name when not
going through prelinker. Use #pragma map to remap
a name and use the remapped name on ENTRY statement when prelinking.
C and COBOL routines that make up an ILC application are executed together in a single run unit (the equivalent of a Language Environment enclave). However, unlike in earlier versions of COBOL (VS COBOL II and OS/VS COBOL), the first COBOL program in a run unit is no longer necessarily considered the main program. If the first COBOL program is not the first program in the enclave to run, it is considered a subroutine in the Language Environment enclave. ![]() ![]() ![]() |
![]() |