COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Binary Value StoredData Description
00110000 00110101PIC S99 SIGN TRAILING VALUE 5
00110000 10110101PIC S99 SIGN TRAILING VALUE -5
00000000 00000000PIC S99 SIGN TRAILING VALUE 0
• NATIVE-n
HP COBOL stores a NATIVE-n data item as a signed, numeric, twos-complement, binary
integer. A NATIVE-n data type is stored in n bytes:
StorageData Type
2 bytesNATIVE-2
4 bytesNATIVE-4
8 bytesNATIVE-8
Handling Variable-Length Records
Software for systems other than NonStop systems sometimes provides a mechanism for writing
variable-length blocked records on tape—usually a block-length field at the beginning of each
block and a record-length field at the beginning of each record. HP software does not have a
similar mechanism. If your HP COBOL program must read a file tape that has variable-length
blocked records and was not created on an HP system, you must write HP COBOL or pTAL code
to deblock the records. It might be easier to produce another tape with fixed-length records (blocked
or not) on the system on which the file was created.
Adding DEFINEs for Tape Files
If your HP COBOL program assigns a tape file to a DEFINE name (which is optional for an unlabeled
tape file, but required for a labeled tape file), then you must add that DEFINE name before executing
your program, or the program will not be able to open the file.
The values of the DEFINE attributes must match corresponding values in the tape label. The tape
process compares corresponding values when the program tries to open the tape file, and if any
corresponding values do not match, the tape process issues an error message, and the open
operation fails (see Consistency Checking of Labeled Tape Information).
These topics explain the attributes of DEFINEs for:
• Unlabeled Tape Files
• Labeled Tape Files
In the Guardian environment, you must enable the creation of DEFINEs with the TACL command
SET DEFMODE ON before you can add them. In the OSS environment, you can add DEFINEs
with the command add_define.
An HP COBOL program running in the OSS environment can assign a file to “GUARDIAN
tape-device” or “GUARDIAN define-name.” In the latter case, you must use the add_define
command to create a TAPE DEFINE before running the program.
Unlabeled Tape Files
The attributes of unlabeled tape files are:
• CLASS Attribute (Required)
• DEVICE Attribute (Required)
Adding DEFINEs for Tape Files 847










