COBOL Manual for TNS and TNS/R Programs

Data Division
HP COBOL Manual for TNS and TNS/R Programs522555-006
7-29
File Description Entries
CODE-SET Clause
The CODE-SET clause specifies the character code convention used to represent data
on the external media supporting the file.
alphabet-name
is the character set used to represent data on external media. It determines the
way external codes are converted to native character codes during input and
output operations. It must be defined in the SPECIAL-NAMES paragraph to be
STANDARD-1, STANDARD-2, or NATIVE (all of which designate the ASCII
character set), or a system-name predefined by HP COBOL as an alternate
alphabet name. The only such system-name is EBCDIC.
Usage Considerations:
Sequential Files Only
You can specify the CODE-SET clause only for sequential files that do not have
alternate keys. On files associated with the $RECEIVE device, the CODE-SET
clause has no effect.
Action of CODE-SET EBCDIC
The presence of the CODE-SET clause causes translation between the native
USASCII character code convention and the EBCDIC code convention for all input
and output operations, regardless of the type of the device associated with the
sequential file.
If you specify CODE-SET EBCDIC in the file description associated with a printer,
EBCDIC codes are delivered to the printer (which may or may not be prepared to
accept EBCDIC codes).
The most common use for CODE-SET EBCDIC is for reading or writing tapes for
interchange with an EBCDIC-based system.
Restrictions Established by the CODE-SET Clause
When the CODE-SET clause appears, it places these restrictions on all data items
defined in the record description entries associated with the file description entry:
°
Some SIGN SEPARATE clause must apply to every signed numeric data item
°
Every data item must be USAGE DISPLAY.
CODE-SET
IS
alphabet-name
VST087.vsd