COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
The value of LINAGE-COUNTER is automatically set to 1 when its file is opened. During
execution of a WRITE statement to its file, LINAGE-COUNTER is automatically modified under
these conditions:
◦ When the ADVANCING PAGE phrase of a WRITE statement is encountered,
LINAGE-COUNTER is reset to 1.
◦ When the ADVANCING phrase is specified in a WRITE statement, LINAGE-COUNTER
is increased by the number of lines given.
◦ When the ADVANCING phrase of the WRITE statement is not used, LINAGE-COUNTER
is increased by 1.
◦ When execution of a WRITE statement repositions the file to the first line in the page body
of the next logical page, LINAGE-COUNTER is reset to 1.
If the file description entry containing the LINAGE clause includes the EXTERNAL clause as
well, the file then has the external attribute. In this case, the LINAGE-COUNTER special register
is also an external data item. Execution of a WRITE statement for such a file by any programs
that share access to the file modifies the same unique special register.
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).
172 Data Division










