COBOL Manual for TNS and TNS/R Programs
Language Elements
HP COBOL Manual for TNS and TNS/R Programs—522555-006
3-4
Punctuation Characters
Punctuation Characters
Punctuation characters belong to the COBOL character set and are listed in Table 3-2.
In a COBOL source program, you can use a punctuation character in these contexts:
•
Separators
•
Comments
•
Nonnumeric and National Literals
•
Numeric Literals and PICTURE Character-Strings
Separators
A separator is one or more consecutive punctuation characters used to separate
character-strings, sentences, or special clauses or to delimit other characters in
expressions. The punctuation characters that can be used as separators are:
•
Space
•
Comma or Semicolon
•
Colon
•
Period
•
Quotation Marks
•
Parentheses
•
Equal Sign
Every character-string must be followed by a sequence of one or more separators. The
syntactic definition of the COBOL language specifies when a sequence can or must
contain any of the period, parentheses, colon, or pseudo-text separators. A space
separator can always immediately precede or follow any other separator, except where
the reference format rules specify otherwise (see Reference Format for Source
Program Lines).
Space
A space character is a separator. Anywhere that a space is used as a separator or a
part of a separator, more than one space can be used. The compiler handles all
spaces immediately following a comma, semicolon, or period separator as part of that
separator and not as a distinct space separator.
Note. The rules for using the punctuation characters as separators do not apply within
comments, nonnumeric literals, numeric literals, or PICTURE character-strings)