Language Environment-conforming assembler invoking an HLL main routine

When a C, C++, or PL/I main routine is called from Language Environment-conforming assembler, the actions in Table 1 take place.

Note: Unlike C, C++, and PL/I, COBOL has no mechanism to statically declare a program “main”; rather, a "main" program is determined dynamically when a COBOL program is the first program in an enclave. Therefore, it is meaningful to call a COBOL "main", only in the context of creating a new enclave in which a COBOL program is the first to run. Only parts of the following tables apply to a COBOL main.
Table 1. What occurs when Language Environment-conforming assembler invokes an HLL main routine
Type of assembler invocation Language Environment is up
CEELOAD macro CEE393 is signaled. CEELOAD cannot load a main routine.
CEEFETCH macro Nested enclave is not created.

The COBOL program could be a main in this case.

EXEC CICS® LINK and EXEC CICS XCTL Nested enclave is created.

The COBOL program could be a main in this case.

EXEC CICS LOAD and BALR This is not supported.
LINK Nested enclave is created.

The COBOL program could be a main in this case.

LOAD and BALR CEE393 is signaled. You cannot LOAD and BALR a main routine under Language Environment.

This is supported in COBOL because the COBOL program would be a subroutine, not a main.

Note: See z/OS Language Environment Programming Guide for information about nested enclaves.