COBOL Manual for TNS/E Programs (H06.03+)
Language Elements
HP COBOL Manual for TNS/E Programs—520347-003
3-4
Separators
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.
Comma or Semicolon
A comma (,) or semicolon (;) that immediately precedes one or more spaces acts as a
comma separator or semicolon separator, respectively. Except where explicitly
prohibited, you can use comma and semicolon separators anywhere that the
specifications permit or require space separators.
Colon
The colon (:) is a separator that COBOL uses to distinguish a reference modifier from a
subscript. The colon marks the end of the leftmost character position portion of the
reference modifier. It is required when shown in a syntax diagram.
Note. The rules for using the punctuation characters as separators do not apply within
comments, nonnumeric literals, numeric literals, or PICTURE character-strings)










