Notations

Throughout this book, the following notation is used to describe the format of COBOL statements:

  1. Words printed in capital letters which are underlined must always be present when the functions of which they are a part are used. An error will be reported by your COBOL system if the underlined words are absent or incorrectly spelled. The underlining is not necessary when writing a COBOL source program.
  2. Words printed in capital letters which are not underlined are used in the COBOL source program for readability only. They may be written, or not, as the programmer wishes, but if written, must be correctly spelled.
  3. All words printed in small letters are generic terms representing names which will be devised by the programmer.
  4. When material is enclosed in braces { }, a choice must be made from the options within them.
  5. When material is enclosed in choice indicators { | | } (or sometimes simply | |), one or more of the unique options must be specified, but a single option may be specified only once.
  6. When material is enclosed in square brackets [ ] , it is an indication that the material is an option which may be included or omitted as required.
  7. When material is enclosed in boxed, square brackets:


    *

    it is an indication that the material is mandatory for ANSI'74 COBOL (American National Standards Institute publication X3.23-1974) but may be optionally omitted as an extension to that language specification. The symbol adjacent to the box or appearing in the margin indicates the dialects of COBOL in which that material is optional. See rule 12 for further details on dialect features.

  8. In text, the ellipsis (...) shows the omission of a portion of a source program or a sequence. This meaning becomes apparent in context.

    In the General Formats, the ellipsis represents the position at which repetition may occur at the user's option. The portion of the format that may be repeated is determined as follows:

    Given ... in a clause or statement format, scanning right to left, determine the } or ] immediately to the left of the ...; continue scanning right to left and determine the logically matching { or [; the ... applies to the words between the determined pair of delimiters.

  9. In the text, any required relational characters '<', '>', and '=' are not underlined to avoid confusion with other symbols such as '>' (greater than or equal to).
  10. Where the term "integer" appears in the general formats, integer must be a numeric literal which is an integer, and must be neither signed nor zero unless explicitly allowed by the rules of that format.
  11. This Reference presents the syntax of IBM SAA AD/Cycle COBOL370 (COBOL/370) statements and the rules for writing source programs that are to be compiled by the COBOL/370 compiler.

    The only distinction Micro Focus COBOL makes between COBOL/370 and IBM VS COBOL II is that for the procedure-pointer format, the default length is eight bytes rather than four bytes.

  12. This Reference presents the syntax of Multivendor Integration Architecture (MIA) - Technical Requirements for the programming language COBOL. No boxes or dialect symbols for MIA are used in this book.
  13. The COBOL language accepted by most COBOL compilers includes extensions to the COBOL language defined in American National Standard X3.23-1974. Different compilers allow different extensions to this standard which means that different versions, called 'dialects', of COBOL exist. This COBOL product is designed for use in cross-development; it can be used for developing not only programs for use on your COBOL system itself but also programs for use with IBM OS/VS COBOL, IBM VS COBOL II, IBM COBOL/370 or IBM COBOL for OS/390 & V2R2, or programs that conform entirely to ANS X3.23-1974 or its successor ANS X3.23-1985. It allows most extensions that are in the IBM COBOLs, and all the features from ANS X3.23-1985 and X3.23a-1989.

    To help you keep to the appropriate dialect - that of your target system - this book shows the dialects in which each feature appears:

    • In the text, features outside ANS X3.23-1974 are in separate paragraphs, with a symbol indicating the dialect at the start of the paragraph.
    • Where a complete section is a separate dialect, the heading of the section is followed by a symbol in a paragraph by itself.
    • A phrase which is part of a separate dialect is separated out into a paragraph on its own, marked as indicated above.
    • In syntax diagrams, features outside ANS X3.23-1974 are enclosed in boxes, with symbols adjacent to the boxes or in the margin. For example:

      GUID-DAF10DD2-79A1-41D0-8312-6781AE172A18-low.png

    The symbols used are as follows:

    OSVS   These features are extensions to ANS X3.23-1974 that appear in IBM OS/VS COBOL.
    VSC2   These features are extensions to ANS X3.23-1985 that appear in IBM VS COBOL II.
    COB370   These features are extensions to ANS X3.23-1985 that are supported in IBM SAA AD/Cycle COBOL/370, but not in IBM VS COBOL II.
    OS390   These features are extensions to ANS X3.23-1985 that are supported in IBM COBOL for OS/390 & V2R2, but not in IBM SAA AD/Cycle COBOL/370.
    ENT   These features are extensions to ANS X3.23-1985 that are supported in Enterprise COBOL for z/OS, but not IBM COBOL for OS/390.
    ANS85     These features are features defined in ANS X3.23-1985 which are not supported under ANS X3.23-1974.
    XOPEN   These features are extensions to ANS X3.23-1985 that appear in the X/Open CAE Specification, COBOL language (XPG-4).
    MF   These features are extensions to ANS X3.23-1985 that are specific to Micro Focus COBOL.
    ISO2002   These features are features defined in ISO/IEC 1989:2002 which are not supported under ANS X3.23-1985.
    NET   These Micro Focus features are only supported under the Microsoft .NET managed CLR platform. These features may be referred to as COBOL for .NET or NET COBOL.
    JVM   These Micro Focus features are only supported under the JVM managed platform. These features may be referred to as COBOL for JVM or JVM COBOL.
    Note:
    • The Micro Focus, VS COBOL II, COBOL/370, OS/390 and X/Open dialects are all based on the ANS X3.23-1985 COBOL Standard. Therefore, any syntax (or rules) which are marked as valid for ANS85 are also valid for Micro Focus, VS COBOL II, COBOL/370, OS/390 and X/Open unless explicitly designated otherwise.
    • The COBOL/370 dialect includes all of the syntax included in VS COBOL II which is marked with a VSC2 bubble in this book. The only time that a COB370 bubble appears in this book are cases where COBOL370 (with the NOCMPR2 compiler option) includes additional or different text than that included with VS COBOL II (with the NOCMPR2 compiler option).
    • The OS390 dialect includes all of the syntax included in VS COBOL II that is marked with a VSC2 bubble. The only time that an OS390 bubble appears in this book are cases where OS390 (with the NOCMPR2 compiler option) includes additional or different text than that is included with VS COBOL II (with the NOCMPR2 compiler option).
    • The Enterprise Cobol dialect includes all of the syntax included in VS COBOL II which is marked with a VSC2 bubble. The only time that an ENT bubble appears in this book is in cases where Enterprise Cobol (with the NOCMPR2 compiler option) includes additional or different text than that included with VS COBOL II (with the NOCMPR2 compiler option).

    These bubbles reflect support only for a particular syntax and its semantics. You have to use Compiler directives to effect a set of reserved words associated with a particular dialect. See the appendix Reserved Words in this book and your Compatibility Guide, if your COBOL system has one, for a list of the reserved words for various dialects.

    Thus, for example, if you are developing a program for use on IBM OS/VS COBOL, you can use the unmarked features plus any marked OSVS; while if developing solely for your COBOL environment you can use any feature. If you supply the FLAG Compiler directive when you invoke the system software, your COBOL system software flags any features outside the given dialect. You can also use the FLAGAS Compiler directive to turn flagging messages into error messages.

  14. Elements within a diagram, which are marked for particular dialect(s), may enclose some other elements in the diagram, which are marked for other dialect(s). This indicates that the enclosed elements extend the syntax when the nested dialects are used.

    In the following example, the ID element is valid with OSVS, VSC2 and Micro Focus dialects:

    GUID-919F0B8D-4EB5-4D0F-AAAC-AF0137E8BE68-low.png

  15. Some features have different effects in different dialects; you specify a dialect-control directive to select the dialect with which you want compatibility. The boxes around such features are double-ruled.

    Extra reserved words needed by features outside ANS X3.23-1985 are reserved only when the appropriate dialect-control directive is present; this means you can ensure that only the words reserved in the specified dialect are reserved on your target system. If you use only features that need no extra reserved words, and whose effects are the same in all dialects, you need not specify a dialect-control directive.

    The dialect-control directive specifying the ANS X3.23-1985 dialect also causes the few ANS 3.23-1974 features not allowed in ANS X3.23-1985 to be flagged with a warning message.

  16. The phrase "is documentary only" in the text of this book means that the associated coding is accepted syntactically by your COBOL system software, but is ignored when producing the object program.
  17. Hexadecimal values are enclosed in quotation marks and preceded by a lowercase x for nonnumeric values and by a lowercase h for numeric values; for example, x"9D".