COBOL Manual for TNS and TNS/R Programs

Environment Division
HP COBOL Manual for TNS and TNS/R Programs522555-006
6-20
SPECIAL-NAMES Paragraph
literal-1
is an unsigned integer literal or a nonnumeric literal, but not a symbolic-
character figurative constant.
If literal-1 is an unsigned integer literal, its value must be in the range 1
through 256. The value is the ordinal number of a character position in the
computers character set (the first character has ordinal number 1, even
though its representation is octal 00).
If literal-1 is a nonnumeric literal, its value depends on the presence or
absence of literal-2. If literal-2 is present, the value of literal-1
must be exactly one character, and it can be a character that is either before or
after literal-2 in the ASCII collating sequence. If literal-2 is absent,
the value of literal-1 can be a string of one or more characters. The
compiler handles a multicharacter string as an abbreviation for a consecutive
series of literal phrases that identify each of the single characters individually,
in the order they appear in literal-1.
literal-2
is an unsigned integer literal or a nonnumeric literal, but not a symbolic-
character figurative constant.
If literal-2 is an unsigned integer literal, its value must be in the range 1
through 256. The value is the ordinal number of a character position in the
ASCII character set.
If literal-2 is a nonnumeric literal, its value must be exactly one character.
The compiler handles the range literal-1 through literal-2 as an
abbreviation for a consecutive series of literal phrases that specify all ASCII
characters from the lower ordinal position to the higher ordinal position.
The two definitions in Example 6-2 are equivalent.
The two definitions in Example 6-3 are equivalent.
Example 6-2. Defining a Class of Vowels
CLASS VOWEL IS "A" "E" "I" "O" "U" "a" "e" "i" "o" "u"
CLASS VOWEL "AEIOUaeiou"
Example 6-3. Defining a Class of Special Characters
CLASS SPEC-CHAR IS 1 THRU 32
OCT IS "0" THRU "7"
CLASS SPEC-CHAR IS 32 THRU 1