COBOL Manual for TNS and TNS/R Programs
Program Compilation
HP COBOL Manual for TNS and TNS/R Programs—522555-006
11-23
CALL and ENTER Statement Processing: Detailed
Explanation
Delivering the Returned Value
When an ENTER statement has a GIVING phrase, the compiler generates code to
deliver the value that the program returns to a data item in the calling program. The
generated code performs any necessary scaling of the result value, then performs an
assignment according to the rules for an elementary move operation.
Binding or Linking the Object Code
When the compilation source text includes a separately compiled program, and the
compiler reports no error against that program, the target file includes the object code
for that program. The object code for nested programs is inseparable from the code for
their outermost separately compiled program.
When a separately compiled HP COBOL program or a non-COBOL program is
available in object form, and the compiler locates it using a file-mnemonic or
primary search list, the target file includes the object code for that program.
When the COBOL85 compiler finds a program in the secondary or tertiary search list,
or in the COBOLEXT file on the same volume and subvolume as the compiler, the
compiler validates parameters, but does not bind the object code into the target file.
When the NMCOBOL compiler finds a program in the ZCOBSRL, ZCRESRL, or
NMCOBEXT file, the compiler validates parameters, but does not bind the object code
into the target file.
REFERENCE When a formal parameter has the REFERENCE attribute, the actual
parameter supplies access to an object in the calling program.
When an actual parameter is an identifier, the compiler generates code to
pass the address of the associated data item to the called program. In this
case, the calling program and the called program must agree on the
interpretation of the data item value.
When an actual parameter is a file name, the compiler generates code to
pass the address of the file control block. Use this option only where
specified for a program supplied by HP.
OMITTED When the parameter in the calling program is specified by the reserved
word OMITTED, the compiler generates no code to convert or pass
anything. The calling program can use OMITTED only when the called
program has the EXTENSIBLE or VARIABLE attribute. The calling
program and the called program must agree on which operands can be
OMITTED.
Parameter Explanation (page 2 of 2)