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

Language Elements
HP COBOL Manual for TNS/E Programs520347-003
3-19
Literals
char
is any character in the national character set, including a punctuation character. A
national literal can have at most 160 characters, excluding the delimiting quotation
marks.
National literals follow these rules:
The letter N or n and the quotation marks are part of the character-string that
represents the literal; they are not part of the value of the literal.
HP COBOL accepts only the double quotation mark ("), not the apostrophe ('), as a
quotation mark.
The value of a national literal is the ordered sequence of characters in its
representation, excluding the delimiting quotation marks. The maximum number of
characters allowed on a line depends on the column in which the literal begins.
The literal represents a data item of the national category whose value is the value
of the literal.
Punctuation characters appearing within a character-string that represents a
national literal are components of its value and are never interpreted as separators.
Each character is represented internally as 2 bytes.
In general, you can use a national literal anywhere you can use a nonnumeric literal.
Exceptions are:
A national literal cannot be compared to a nonnumeric or numeric literal or to a
data item not defined as national. Compare national literals only to other national
literals or national data items.
A national literal cannot be specified in these paragraphs, statements, phrases, or
clauses:
°
SPECIAL-NAMES paragraph
°
PADDING clause of the SELECT statement
°
RECEIVE-CONTROL paragraph
°
INITIALIZE statement when the REPLACING phrase is used
"
char
"
N
n
VST745.vsd