COBOL Manual for TNS and TNS/R Programs

Program Compilation
HP COBOL Manual for TNS and TNS/R Programs522555-006
11-135
UL
In object code produced by the COBOL85 compiler, if a size error condition occurs in
an arithmetic computation for which no SIZE ERROR phrase is present, the program
suspends execution and enters the selected debugger with a trap 2 (arithmetic
overflow) condition.
When a set of separately compiled COBOL programs constitute a run unit, if any of the
programs is the product of compilation by the COBOL85 compiler, the main program
must be a product of the COBOL85 compiler. Also, although an HP COBOL program
can call a COBOL 74 program, a COBOL 74 program cannot call an HP COBOL
program. During conversion from COBOL 74 to HP COBOL, it can occur that the main
program has been converted to HP COBOL, but some of the subprograms are in
COBOL 74. When that is the case, if an arithmetic overflow occurs in the COBOL 74
code, the program drops into the debugger. If the program is working correctly, this is
obviously an awkward situation.
If you compile the main program with the COBOL85 compiler, and include the
NOTRAP2 directive, the compiler does not activate the arithmetic overflow trapping
mechanism. This then approximates the behavior of COBOL 74, although the
undefined result might have a different value.
If you want the HP COBOL program to have overflow trapping, but you want the
COBOL 74 programs it calls not to have the trapping, include the NOTRAP2-74
directive in the COBOL85 compilation.
UL
UL directive tells the NMCOBOL compiler that the resulting object code will be in a
native library. The NMCOBOL compiler does not put any data in the small data area,
and it tells the linker to export the entry point names of all separately compiled
programs in the compilation unit.
Note. The COBOL85 compiler does not recognize this directive.
Default: None
Placement: Before the first IDENTIFICATION DIVISION header of the first program
in the compilation unit
Scope: Applies to the compilation unit
Dependencies:
If RUNNABLE is active, UL uses the linker to create a PIC library file
(DLL); otherwise, UL creates a PIC linkfile.
Do not use with CALL-SHARED, NON-SHARED, or SHARED.
References:
CALL-SHARED
SHARED
UL
VST735.vsd