COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

A program can specify a NATIVE-n data item as an operand anywhere that it can specify a
BINARY/COMPUTATIONAL item (of equivalent size in character positions), such as in arithmetic
expressions, MOVE statements, and so on. In all cases, the value of the item is interpreted as
a signed integer.
How NATIVE-n and COMPUTATIONAL-5 Formats Differ
The difference between a NATIVE-n data item and a COMPUTATIONAL-5 data item is that
the NATIVE-n data item is 2-byte-aligned and the COMPUTATIONAL-5 data item is byte-aligned
and requires a PICTURE clause (see PICTURE Clause (page 191)).
POINTER Data Items
Clauses not allowed
A group or elementary data item described with a USAGE POINTER clause cannot have
any other clauses except VALUE IS NULL or VALUE IS NULLS. The clause VALUE IS NULL
or VALUE IS NULLS initializes the pointer to a value (all ones) that causes an address fault
if the pointer is referenced.
How HP COBOL pointers differ from HP C and Pascal pointers
An HP COBOL POINTER data item is not the same as a pointer in HP C or Pascal. An
HP COBOL POINTER data item merely provides a container for an address. You can
access an HP COBOL POINTER data item only in a conditional expression, a SET
statement, or as a parameter in the USING phrase of a CALL or ENTER statement.
The statement
MOVE "ABC" TO PTR1
where PTR1 is an HP COBOL pointer, does not move the value “ABC” to the address that
PTR1 contains.
For an HP COBOL pointer to accomplish what an HP C or Pascal pointer accomplishes,
you must declare a base data item in the Linkage Section. You must not put the base data
item in the USING phrase of the PROCEDURE DIVISION heading (that is, you must not
pass the base data item as a parameter).
SIGN Clause
The SIGN clause specifies the position and mode of representation of the operational sign for a
numeric data item. It can only be used for DISPLAY items with an S in the PICTURE character-string.
This precludes the use of the SIGN clause with USAGE NATIVE-n or USAGE POINTER.
Usage Considerations:
Function of the SIGN Clause
The representation of every signed numeric data item includes an operational sign. When the
data item is USAGE BINARY or USAGE COMPUTATIONAL, the compiler automatically chooses
the appropriate sign convention in accordance with the item’s internal representation. When
the data item is USAGE DISPLAY, the SIGN clause determines the position and representation
of the sign. When no SIGN clause is used, SIGN TRAILING is assumed.
210 Data Division