Rules for Separators
- A space [␢]
- A space can immediately
precede or follow any separator except:
- The opening pseudo-text delimiter (where the preceding space is required).
- Within quotation marks (or apostrophes if the APOST option is in effect). Spaces between quotation marks are considered part of the nonnumeric literal; they are not considered separators.
- Period [.␢], Comma [,␢], Semicolon [;␢]
- A separator period, comma,
or semicolon is composed of a period, comma, or semicolon followed
by a space. The separator period must be used only to indicate the
end of a sentence, or as shown in formats. The separator comma and
separator semicolon may be used anywhere the separator space is used.
- In the Identification Division, separator commas and separator semicolons can be used in the comment-entries. Each paragraph must end with a separator period.
- In the Environment Division, separator commas or separator semicolons may separate clauses and operands within clauses. The SOURCE-COMPUTER, OBJECT-COMPUTER, SPECIAL-NAMES, and I-O-CONTROL paragraphs must each end with a separator period. In the FILE-CONTROL paragraph, each File-Control entry must end with a separator period.
- In the Data Division, separator commas or separator semicolons may separate clauses and operands within clauses. File (FD), Sort/Merge file (SD), and data description entries must each end with a separator period.
- In the Procedure Division, separator commas or separator semicolons may separate statements within a sentence, and operands within a statement. Each sentence and each procedure must end with a separator period.
- Parentheses [ ( ] . . . [ ) ]
- Except in pseudo-text, they must appear as balanced pairs of left and right parentheses. They delimit subscripts, a list of function arguments, reference modification, arithmetic expressions, and conditions.
- Quotation marks [␢"] . . . ["␢]
- An
opening quotation mark must be immediately preceded by a space or
a left parenthesis. A closing quotation mark must be immediately followed
by a separator (space, comma, semicolon, period, or right parenthesis).
Quotation marks must appear as balanced pairs. They delimit nonnumeric
literals, except when the literal is continued (see Continuation Lines). IBM Extension
Under the *APOST compiler option, or the APOST PROCESS option, an apostrophe can be used in place of a quotation mark.
End of IBM Extension - Pseudo-text delimiters [␢==]… literal-2 [==␢]
- An opening pseudo-text delimiter must be immediately preceded by a space. A closing pseudo-text delimiter must be immediately followed by a separator (space, comma, semicolon, or period). Pseudo-text delimiters must appear as balanced pairs. They delimit pseudo-text. (See COPY Statement and REPLACING Phrase.)
- Colon [ : ]
- The colon is a separator, and is required when shown in general formats.
B" is a separator when used to describe a Boolean literal. The B must immediately precede the quotation mark.
X" is a separator when used to describe a hexadecimal nonnumeric literal. The X must immediately precede the quotation mark.
G" is a separator when used to describe a DBCS literal. The G must immediately precede the quotation mark.
N" is a separator when used to describe a DBCS literal, or a national literal when NATIONALPICNLIT PROCESS option is in effect. The N must immediately precede the quotation mark.
NX" is a separator when used to describe a national hexadecimal literal. The NX must immediately precede the quotation mark.
Z" is a separator when used to describe a null-terminated nonnumeric literal. The Z must immediately precede the quotation mark.