COBOL Manual for TNS/E Programs (H06.03+)
Language Elements
HP COBOL Manual for TNS/E Programs—520347-003
3-17
Literals
hex-digit
is one of the characters 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, a, b, c, d, e, f.
The maximum number of hex-digits in a hexadecimal numeric literal is 16 (eight
pairs).
A hexadecimal numeric literal is considered an unsigned integer. It can appear
anywhere that a decimal numeric literal can appear.
Simple Nonnumeric Literals
A simple nonnumeric literal is a character-string that has the value of the sequence of
its characters.
char
is an alphanumeric character or a quotation mark ("). If char is a quotation mark,
it must be immediately followed by another quotation mark. Each pair of quotation
marks represents a single embedded quotation mark. A simple nonnumeric literal
can have at most 160 characters, excluding the delimiting quotation marks.
Simple nonnumeric literals follows these rules:
•
The literal must be both preceded and followed by at least one separator.
•
The delimiting 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 literal does not include the second of two consecutive quotation marks that
represent a single, embedded one.
•
All other characters in the literal represent themselves as a part of the literal’s
value and have no other interpretation. Lowercase letters are not equivalent to
their uppercase counterparts. Punctuation characters are not interpreted as
separators.
Example 3-4. Hexadecimal Numeric Literals
H"00"
H"0F"
H"0123456789ABCDEF"
H"1003c55b"
VST744.vsd
"
char
"










