About this information

Welcome to IBM® COBOL for AIX®, IBM's COBOL compiler and run time for AIX!

There are some differences between host and workstation COBOL. For details about language and system differences between COBOL for AIX and Enterprise COBOL for z/OS®, see Summary of differences from host COBOL.

How this information will help you

This information will help you write, compile, link-edit, and run IBM COBOL for AIX programs. It will also help you define object-oriented classes and methods, invoke methods, and refer to objects in your programs.

This information assumes experience in developing application programs and some knowledge of COBOL. It focuses on using COBOL to meet your programming objectives and not on the definition of the COBOL language. For complete information about COBOL syntax, see the COBOL for AIX Language Reference.

This information also assumes familiarity with AIX. For information about AIX, see your operating system documentation.

Abbreviated terms

Certain terms are used in a shortened form in this information. Abbreviations for the product names used most frequently are listed alphabetically in the table below.

Term used Long form
CICS® IBM TXSeries
COBOL for AIX IBM COBOL for AIX
DB2® Database 2

In addition to these abbreviated terms, the term "Standard COBOL 85" is used in this information to refer to the combination of the following standards:

  • ISO 1989:1985, Programming languages - COBOL
  • ISO/IEC 1989/AMD1:1992, Programming languages - COBOL: Intrinsic function module
  • ISO/IEC 1989/AMD2:1994, Programming languages - Correction and clarification amendment for COBOL
  • ANSI INCITS 23-1985, Programming Languages - COBOL
  • ANSI INCITS 23a-1989, Programming Languages - Intrinsic Function Module for COBOL
  • ANSI INCITS 23b-1993, Programming Language - Correction Amendment for COBOL

The ISO standards are identical to the American National Standards.

Other terms, if not commonly understood, are shown in italics the first time they appear and are listed in the glossary.

How to read syntax diagrams

Use the following description to read the syntax diagrams in this information: Link to detail.

  • Read the syntax diagrams from left to right, from top to bottom, following the path of the line.

    The >>--- symbol indicates the beginning of a syntax diagram.

    The ---> symbol indicates that the syntax diagram is continued on the next line.

    The >--- symbol indicates that the syntax diagram is continued from the previous line.

    The --->< symbol indicates the end of a syntax diagram.

    Diagrams of syntactical units other than complete statements start with the >--- symbol and end with the ---> symbol.

  • Required items appear on the horizontal line (the main path).
    Read syntax diagramSkip visual syntax diagram
    >>-required_item-----------------------------------------------><
    
    
  • Optional items appear below the main path.
    Read syntax diagramSkip visual syntax diagram
    >>-required_item--+---------------+----------------------------><
                      '-optional_item-'   
    
    
  • If you can choose from two or more items, they appear vertically, in a stack. If you must choose one of the items, one item of the stack appears on the main path.
    Read syntax diagramSkip visual syntax diagram
    >>-required_item--+-required_choice1-+-------------------------><
                      '-required_choice2-'   
    
    

    If choosing one of the items is optional, the entire stack appears below the main path.

    Read syntax diagramSkip visual syntax diagram
    >>-required_item--+------------------+-------------------------><
                      +-optional_choice1-+   
                      '-optional_choice2-'   
    
    

    If one of the items is the default, it appears above the main path and the remaining choices are shown below.

    Read syntax diagramSkip visual syntax diagram
                      .-default_choice--.   
    >>-required_item--+-----------------+--------------------------><
                      +-optional_choice-+   
                      '-optional_choice-'   
    
    
  • An arrow returning to the left, above the main line, indicates an item that can be repeated.
    Read syntax diagramSkip visual syntax diagram
                      .-----------------.   
                      V                 |   
    >>-required_item----repeatable_item-+--------------------------><
    
    

    If the repeat arrow contains a comma, you must separate repeated items with a comma.

    Read syntax diagramSkip visual syntax diagram
                      .-,---------------.   
                      V                 |   
    >>-required_item----repeatable_item-+--------------------------><
    
    
  • Keywords appear in uppercase (for example, FROM). They must be spelled exactly as shown. Variables appear in all lowercase letters (for example, column-name). They represent user-supplied names or values.
  • If punctuation marks, parentheses, arithmetic operators, or other such symbols are shown, you must enter them as part of the syntax.

 

How examples are shown

This information shows numerous examples of sample COBOL statements, program fragments, and small programs to illustrate the coding techniques being discussed. The examples of program code are written in lowercase, uppercase, or mixed case to demonstrate that you can write your programs in any of these ways.

To more clearly separate some examples from the explanatory text, they are presented in a monospace font.

COBOL keywords and compiler options that appear in text are generally shown in SMALL UPPERCASE. Other terms such as program variable names are sometimes shown in an italic font for clarity.

Related information

The information in this Programming Guide is available online in the AIX Compiler Information Center, which is available from the COBOL for AIX library page at www.ibm.com/software/awdtools/cobol/aix/library/. The Information Center also has the COBOL for AIX Language Reference and information about using the debugger.