Syntax diagram

The IBM syntax diagram lets you see quickly how to construct a statement or command. An example of such a diagram is as follows:


Example of a syntax diagram

Read the diagram from left-to-right, top-to-bottom, following the main path, which is the line that begins on the left with double arrowheads (>>). As you follow the main path you may select an entry on a subordinate path, in which case you continue reading from left-to-right along the subordinate path.

In the example, the main path is composed of four line segments. It is important to see this. The second and third line segments of the main path each begins with a single arrowhead (>) and includes subordinate information. The fourth line segment of the main path line also begins with a single arrowhead (>), includes returning arrows and subordinate information, and ends with two arrowheads facing each other (><).

A term (or symbol) that is not in italics must be specified exactly as shown. In the example, you specify the term RequiredTerm as is. In contrast, a term in italics is a placeholder for a value that you specify. In the example, you might include any of the following symbols in place of RequiredValue:

  myVariable
  50
  "Oh!"

The specific requirements for an italicized term (for example, whether a string or number is appropriate) are explained in the text that follows the syntax diagram, not in the syntax diagram itself.

If a diagram shows a non-alphanumeric character, you type that character as part of the syntax. After you specify a value for RequiredValue, for instance, you type a colon (:) and a blank.

If you are allowed to select from any of several terms, the terms are shown in a stack. In the example, you can specify the term Alternative01 or Alternative02.

If (as in this case) you must select a term from those listed in a stack, one of the choices (arbitrarily specified) is on the top line of the stack. If you are not required to select a term, the terms are all below the top line of the stack, as is true of OptionalTerm01.

A value that is on a path but is shown in an elevated way (as is true of = yes) is the default value for the stack in which the value appears. The example indicates that you can specify any of the following strings, and the first two are equivalent:

optionalTerm01 = yes

optionalTerm01

optionalTerm01 = no

OptionalTerm02

An arrow returning to the left above a term indicates that you can use the term repeatedly. In the example, you specify values for property, each separated from the next with a comma.

An arrow returning to the left above a vertical stack means that you can choose from the list of entries in any order. In the example, each of the following strings is valid (as are other variations), but none is required:

  OptionalTerm04 OptionalTerm05
  OptionalTerm06
  OptionalTerm04 OptionalTerm06 OptionalTerm05