How to read syntax diagrams

Certain conventions apply to the syntax diagrams that are used in IBM® documentation.
Apply the following rules when reading syntax diagrams:
  • 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 statement.

    The –> symbol indicates that the statement syntax is continued on the next line.

    The >– symbol indicates that a statement is continued from the previous line.

    The –>< symbol indicates the end of a statement.

    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
    >>-RequiredItem------------------------------------------------><
    
    
  • Optional items appear below the main path.
    Read syntax diagramSkip visual syntax diagram
    >>-RequiredItem--+--------------+------------------------------><
                     '-OptionalItem-'   
    
    

    If an optional item appears above the main path, that item has no effect on the execution of the statement and is used only for readability.

    Read syntax diagramSkip visual syntax diagram
                     .-OptionalItem-.   
    >>-RequiredItem--+--------------+------------------------------><
    
    
  • 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
    >>-RequiredItem--+-RequiredChoice1-+---------------------------><
                     '-RequiredChoice2-'   
    
    

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

    Read syntax diagramSkip visual syntax diagram
    >>-RequiredItem--+-----------------+---------------------------><
                     +-OptionalChoice1-+   
                     '-OptionalChoice2-'   
    
    

    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
                     .-DefaultChoice--.   
    >>-RequiredItem--+----------------+----------------------------><
                     +-OptionalChoice-+   
                     '-OptionalChoice-'   
    
    
  • An arrow returning to the left, above the main line, indicates an item that can be repeated.
    Read syntax diagramSkip visual syntax diagram
                     .----------------.   
                     V                |   
    >>-RequiredItem----RepeatableItem-+----------------------------><
    
    

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

    Read syntax diagramSkip visual syntax diagram
                     .-,--------------.   
                     V                |   
    >>-RequiredItem----RepeatableItem-+----------------------------><
    
    

    A repeat arrow above a stack indicates that you can repeat the items in the stack.

  • Sometimes a diagram must be split into fragments. The syntax fragment is shown separately from the main syntax diagram, but the contents of the fragment should be read as if they are on the main path of the diagram.
    Read syntax diagramSkip visual syntax diagram
    >>-RequiredItem--| Fragment Name |-----------------------------><
    
    Fragment Name
    
    |--RequiredItem--+--------------+-------------------------------|
                     '-OptionalName-'   
    
    
  • Keywords appear in upper case (for example, FROM). Keywords must be spelled exactly as shown, although any of the letters may be upper or lower case. Variables appear in all mixed-case italics (for example, NumericExpression). 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.


Feedback | Information roadmap