ILE COBOL Language Reference

Rules for Separators

In the following description, brackets enclose each separator. Anywhere a space is used as a separator, or as part of a separator, more than one space may be used.

A space [ ]
A space can immediately precede or follow any separator except:
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.

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.

+-------------------------------IBM Extension--------------------------------+

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. 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.

+----------------------------End of IBM Extension----------------------------+

Note:
Any punctuation character included in a PICTURE character-string, a comment character-string, or a nonnumeric literal is not considered as a punctuation character, but rather as part of the character-string or literal.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]