Mainframe Blog

How to Read IBM® Syntax Diagrams for Db2 12

2 minute read
Stephen Watts

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

(This article is part of our Db2 Guide. Use the right-hand menu to navigate.)

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.

Order now! Get your free Db2 collateral from BMC!

Get your free Reference Guide and Catalog Tables Poster for z/OS from BMC. This collateral helps Db2 for z/OS users with daily activities in administering and programming for Db2 on z/OS.


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

See an error or have a suggestion? Please let us know by emailing blogs@bmc.com.

Business, Faster than Humanly Possible

BMC works with 86% of the Forbes Global 50 and customers and partners around the world to create their future. With our history of innovation, industry-leading automation, operations, and service management solutions, combined with unmatched flexibility, we help organizations free up time and space to become an Autonomous Digital Enterprise that conquers the opportunities ahead.
Learn more about BMC ›

About the author

Stephen Watts

Stephen Watts (Birmingham, AL) contributes to a variety of publications including, Search Engine Journal, ITSM.Tools, IT Chronicles, DZone, and CompTIA.