Rational Developer for System z
Enterprise COBOL for z/OS, Version 4.1, Compiler and Runtime Migration Guide


Calling assembler programs that expect a certain program mask

When you are running mixed COBOL and assembler programs in a application under Language Environment, called assembler programs cannot rely on a predictable program mask. You could experience ABEND 0CA (decimal overflow) in your assembler program when running such a mixed application with Language Environment. If an assembler program has certain program mask requirements, it must set the program mask to what it needs and then restore the program mask before returning.
: With VS COBOL II, the program mask always had the same setting when an assembler program was called.

Language Environment sets the program mask based on the requirements of the High-Level Languages (HLLs) that are initialized in the enclave. Each HLL informs Language Environment of its program mask requirements, and Language Environment ORs all of the requirements together and sets the program mask accordingly.

Language Environment neither saves nor restores the program mask setting across calls to Language Environment services or calls within the Language Environment environment.

The program mask requirement for COBOL is to have each mask setting OFF, but the other HLLs have requirements for one or more of the program masks to be set ON. This table shows some of these requirements:
Table 1. Program mask requirement by HLL
Language Fixed-Point Overflow mask Decimal Overflow mask Exponent Underflow mask Significance mask
C/C++ OFF ON OFF OFF
PL/I MVS & VM ON ON ON OFF
Enterprise PL/I OFF ON ON OFF

To support the language semantics when one or more program mask settings are ON, Language Environment uses the condition handling enablement step to determine which exceptions should be enabled (that is, treated as conditions) and which should be ignored, based on the language that is currently active on the stack.

Example scenario: When COBOL and C/C++ are both initialized, the decimal overflow mask is ON and all the other mask settings are OFF. When there is a decimal overflow in a COBOL program or a COBOL runtime routine, Language Environment condition handling gets control for the exception. During the enablement step, Language Environment determines that COBOL wants to ignore the decimal overflow and resume. Language Environment then resumes the application. If the decimal overflow occurs while an assembler program or a C routine is active, the exception is enabled; and a condition is signalled.
There are cases when both COBOL and C/C++ are initialized even though only COBOL programs are run. For example, COBOL requires the C/C++ run time in the following cases:

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)