How to Read IBM<sup>®</sup> Syntax Diagrams for Db2 12

How to Read IBM® Syntax Diagrams for Db2 12

  • Mainframe
6 minute read Updated Apr 1, 2019

TL;DR Summary: Understanding IBM® Syntax Diagrams for Db2 12 involves following a structured approach to read diagrams effectively. Key symbols indicate required, optional, and repeatable items, guiding users through statement structures.

  • Required items are on the main path; optional items appear below.
  • Repeatable items are indicated by arrows returning to the left.

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

    The >>--- symbol indicates the beginning of the 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).

    >>__required_item________________________________________________________________><

Optional items appear below the main path.

    >>__required_item________________________________________________________________><
         ǀ_optional_item_ǀ

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.

    _optional_item_
>>__required_item__ǀ______________ǀ______________________________________________><

If you can choose from two or more items, they appear vertically, in a stack. If you must choose one of the items, on item of the stack appears on the main path.

    >>__required_item____required_choice1____________________________________________><
                  ǀ_required_choice2_ǀ

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

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

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

    <_________________
>>__required_item______repeatable_item_ǀ_________________________________________><

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

    <_,________________
>>__required_item______repeatable_item_ǀ_________________________________________><

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

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.

Disclaimer: This Db2® 12 for z/OS Reference Guide was developed to help users in their daily activities in administrating and programming in Db2 for z/OS. There are no guarantees expressed or implied with the contents in this guide. We want to provide a quality and useful reference for users. Please notify us of any mistakes or errors in this reference guide at blogs@bmc.com. Db2 is a registered trademark of the IBM Corporation.

These postings are my own and do not necessarily represent BMC's position, strategies, or opinion.

More from Mainframe

Subscribe to The Brief

By registering for this offer you are confirming that you have read and agreed to BMC’s Privacy Policy.

Thank you

You have subscribed to The Brief
The Brief covers the mainframe and enterprise orchestration—BMC AMI and Control-M—and the analyst research, customer deployments and events across both.