A separator is a string of one or more punctuation characters. The rules for formation of separators are:
- The punctuation character space is a separator. Wherever a space is used as a separator or as part of a separator, more than
one space can be used. All spaces immediately following the separators comma, semicolon, or period are considered part of
that separator and are not considered to be the separator space.
- Except when the comma is used in a PICTURE character-string, the punctuation characters comma and semicolon, immediately followed
by a space, are separators that can be used anywhere the separator space is used.
- The punctuation character period, when followed by a space, is a separator. It must be used only to indicate the end of a
sentence, or as shown in formats.
- The punctuation characters right and left parenthesis are separators. Except in pseudo-text, parentheses can appear only
in balanced pairs of left and right parentheses delimiting subscripts,
a list of function arguments, reference modifiers,
arithmetic expressions, or conditions.
- The opening delimiters and closing delimiters of literals are separators.
Either an apostrophe or a quotation mark may be used as the quotation symbol character in opening and closing delimiters.
The opening delimiters of literals are:
- A quotation mark symbol
- Any of the following pairs of contiguous characters: G", G', H", H', N", N', X", X', Z", Z'
The closing delimiters of literals are:
- A quotation mark when the opening delimiter uses a quotation mark
- An apostrophe when the opening delimiter uses an apostrophe
The opening delimiter must be immediately preceded by a space, left parenthesis or opening pseudo-text delimiter. The closing
delimiter must be immediately followed by one of the separators space, comma, semicolon, period, right parenthesis or closing
pseudo-text delimiter. Separators immediately preceding the opening delimiter are not part of the opening delimiter. Separators
immediately following the closing delimiter are not part of the closing delimiter.
- Pseudo-text delimiters are separators. An opening pseudo-text delimiter must be immediately preceded by a space; a closing
pseudo-text delimiter must be immediately followed by one of the separators space, comma, semicolon, or period.
The space immediately preceding the opening pseudo-text delimiter can be omitted.
Pseudo-text delimiters can appear only in balanced pairs delimiting pseudo-text
. (See the topic Source Text Manipulation and the topic Method Interface Definition.)
- The COBOL character colon, except as part of the invocation operator, is a separator and is required when shown in the general
- The separator space can immediately precede all separators except the following:
- As specified by reference format (see the section Reference Format in the chapter Language Fundamentals).
- The separator closing quotation mark. In this case, a preceding space is considered as part of the nonnumeric literal and
not as a separator.
- The opening pseudo-text delimiter, where the preceding space is required.
- The separator space can optionally immediately follow any separator except the opening quotation mark. In this case, a following
space is considered as part of the nonnumeric literal and not as a separator.
Any punctuation character which appears as part of the specification of a PICTURE character-string (see the topic The PICTURE Clause) or numeric literal is not considered to be a punctuation character, but rather a symbol. PICTURE character-strings are delimited
only by the separators space, comma, semicolon, or period.
The rules established for the formation of separators do not apply to the characters which comprise the contents of nonnumeric
literals, comment-entries, or comment lines.