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

Language Elements
HP COBOL Manual for TNS/E Programs520347-003
3-6
Numeric Literals and PICTURE Character-Strings
Numeric Literals and PICTURE Character-Strings
Several punctuation characters (comma, period, left parenthesis, right parenthesis) are
also defined as characters available for the formation of numeric literals and PICTURE
character-strings. They are not separators in these contexts but instead represent a
part of that language element; however, an exception exists if the apparent last
character of such a character-string is a period or comma immediately followed by a
space. In this case, the period or comma is always interpreted as part of the separator
following the character-string, and not as the last character of the numeric literal or
PICTURE character-string.
Character-Strings
A character-string consists of one or more characters that form:
COBOL Words
Literals
PICTURE Character-Strings
Comments
Most character-strings are limited to certain characters, but nonnumeric literals (except
for hexadecimal literals beginning with X ) and comments can contain any characters.
Character-strings and separators form the text of COBOL source programs.
COBOL Words
char-1
char-n
If the COBOL word is a level-number or segment-number, then char-1 is a digit.
If the COBOL word is a section-name or paragraph-name, then these rules apply:
char-1 is a letter (uppercase or lowercase) or a digit.
char-n is a letter (uppercase or lowercase), a digit, or a hyphen (-).
The last character cannot be a hyphen.
The maximum length of the word is 30 characters.
char-1
char-n
ns
ns
VST741.vsd