Separators COBOL

A separator is a string of one or more of the characters marked with a1 in Table.

RM/COBOL Character Set

Separators are formed according to the following rules:

  1. A space is a separator. Anywhere a space is used as a separator or as part of a separator, more than one space may be used.
  2. Commas, semicolons, and periods are separators when they are immediately followed by a space. At any point in the syntax where a space is allowed, a comma separator or semicolon separator is also allowed.
  3. Parentheses are separators that must appear only in balanced pairs of left and right parentheses. They delimit subscripts, reference modifiers, binary allocation values, arithmetic expressions, constant expressions, and conditions.
  4. Quotation marks are separators that delimit nonnumeric literals. They must always appear in balanced pairs, except when the continuation of a nonnumeric literal is being specified.
  5. opening quotation mark must be immediately preceded by a space or left parenthesis.
  6. closing quotation mark must be immediately followed by a space, comma separator, semicolon separator, period separator, or right parenthesis.
  7. Either the quotation mark or the apostrophe may be used to delimit nonnumeric literals. The apostrophe has the same characteristics as the quotation mark, described above.

  8. The punctuation character colon is a separator and is required when shown in the general formats.
  9. A pair of adjacent equal signs that are not split across a continuation forms a pseudo-text delimiter. A pseudo-text delimiter is a separator.

    Pseudo-text delimiters may be used only in balanced pairs to delimit pseudo-text in COPY and REPLACE statements. 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.

    A space may immediately precede all separators except:

    • If prohibited by specific statement syntax.
    • If the separator is a closing quotation mark. In this case, a preceding space is considered part of the nonnumeric literal, not a separator.
    • The opening pseudo-text delimiter, where the preceding space is required.
  10. A space may immediately follow any separator except an opening quotation mark. In this case,the space is considered part of the nonnumeric literal, not a separator.
  11. Any punctuation character which appears as part of the specification of a PICTURE character-string or numeric literal is not considered a punctuation character; it is treated as a symbol used in the specification of that PICTURE character-string or numeric literal. PICTURE character- strings are delimited only by a space, comma, semicolon or period separator.

These rules do not apply to characters within nonnumeric literals or comments.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

COBOL Topics