Previous Topic: JCL RequirementsNext Topic: Using CA FAVER Functions


Reading Syntax Diagrams

The formats of all statements and some basic language elements are illustrated using syntax diagrams. Read syntax diagrams from left to right and top to bottom.

The following terminology, symbols, and concepts are used in syntax diagrams.

Keywords

Appear in uppercase letters, for example, COMMAND or PARM. These words must be entered exactly as shown.

Variables

Appear in italicized lowercase letters, for example, parm1 or parm2.

Required Keywords and Variables

Appear on a main line.

Optional Keywords and Variables

Appear below a main line.

Default Keywords and Variables

Appear with a left-facing arrow.

Double Arrowheads Pointing to the Right

Indicate the beginning of a statement.

Double Arrowheads Pointing to Each Other

Indicate the end of a statement.

Single Arrowheads Pointing to the Right

Indicate a portion of a statement, or that the statement continues in another diagram.

Punctuation Marks or Arithmetic Symbols

If punctuation marks or arithmetic symbols are shown with a keyword or variable, they must be entered as part of the statement or command. Punctuation marks and arithmetic symbols can include:

,

comma

>

greater than symbol

.

period

<

less than symbol

(

open parenthesis

=

equal sign

)

close parenthesis

¬

not sign

+

addition

-

subtraction

*

multiplication

/

division

No Parameters

The following is an example of a statement without parameters.

Statement Without Parameters
►►─ COMMAND ──────────────────────────────────────────────────────────────────►◄

You must write:

COMMAND
Required Parameters

Required parameters appear on the same horizontal line (the main path of the diagram) as the command or statement. The parameters must be separated by one or more blanks.

Statement With Required Parameters
►►─ COMMAND ─ PARM1 ─ PARM2 ──────────────────────────────────────────────────►◄

You must write:

COMMAND PARM1 PARM2

Delimiters such as parentheses around parameters or clauses must be included.

Delimiters Around Parameters
►►─ COMMAND ─ (PARM1) ─ PARM2='variable' ─────────────────────────────────────►◄

You must write:

COMMAND (PARM1) PARM2='variable'

Where you see a vertical list of parameters as shown in the following example, you must choose one of the parameters. This indicates that only one is required and only one of the displayed parameters is allowed in the statement.

Choice of Required Parameters
►►─ COMMAND ─┬─ CLAUSE1 ─┬────────────────────────────────────────────────────►◄
             ├─ CLAUSE2 ─┤
             └─ CLAUSE3 ─┘

You can choose any of the parameters from the vertical list as shown in the following examples.

COMMAND CLAUSE1
COMMAND CLAUSE2
COMMAND CLAUSE3
Optional Parameters

A single optional parameter appears below the horizontal line that marks the main path.

Optional Parameter
►►─ COMMAND ─┬─────────────┬──────────────────────────────────────────────────►◄
             └─ PARAMETER ─┘

You may or may not use the optional parameter as shown in the following examples:

COMMAND
COMMAND PARAMETER

If you have a choice of more than one optional parameter, the parameters appear in a vertical list below the main path.

Choice of Optional Parameters
►►─ COMMAND ─┬───────────┬────────────────────────────────────────────────────►◄
             ├─ CLAUSE1 ─┤
             └─ CLAUSE2 ─┘

You can choose any of the parameters from the vertical list, or you can write the statement without an optional parameter, such as in the following examples.

COMMAND
COMMAND CLAUSE1
COMMAND CLAUSE2
Multiple Parameters

For some statements, you can specify more than one parameter, or a single parameter more than once. A repeat symbol (a backward-pointing arrow above the main horizontal line) indicates that you can specify multiple parameters. Below are examples which include the repeat symbol.

Repeatable Variable Parameter
             ┌─────────────┐
►►─ COMMAND ─▼─ parameter ─┴──────────────────────────────────────────────────►◄

In the preceding example, the word "parameter" is in lowercase italics, indicating that it is a variable, but it is also on the main path, which means that at least one parameter is required. The repeat symbol indicates that you can specify more than one parameter. Assume that you have three values named PARM-X, PARM-Y, and PARM-Z for the variable. Some of your choices can be:

COMMAND PARM-X
COMMAND PARM-X PARM-Y
COMMAND PARM-Y PARM-Z
COMMAND PARM-X PARM-Y PARM-Z

If the repeat symbol contains punctuation such as a comma, you must separate multiple parameters with the punctuation. The following example includes the repeat symbol, a comma, and parentheses.

Separator with Repeatable Variable and Delimiter
                 ┌─ , ──────┐
►►─ COMMAND ─ ( ─▼─ clause ─┴─ ) ─────────────────────────────────────────────►◄

In the preceding example, the word "clause" is in lowercase italics, indicating that it is a variable, but it is also on the main path, which means that at least one clause is required. The repeat symbol indicates that you can specify more than one clause and that you must separate the clauses with commas. The parentheses indicate that the clauses must be enclosed within parentheses. Assume that you have three values named CLAUSE-X, CLAUSE-Y, and CLAUSE-Z for the variable. Some of your choices can be:

COMMAND (CLAUSE-X)
COMMAND (CLAUSE-X,CLAUSE-Y)
COMMAND (CLAUSE-Y,CLAUSE-Z)
COMMAND (CLAUSE-X,CLAUSE-Y,CLAUSE-Z)

The following example shows a vertical list of parameters with the repeat symbol.

Choice of Repeatable Parameters
             ┌─────────────┐
►►─ COMMAND ─▼─┬─ PARM1 ─┬─┴──────────────────────────────────────────────────►◄
               ├─ PARM2 ─┤
               └─ PARM3 ─┘

Some choices you can make include:

COMMAND PARM2
COMMAND PARM1 PARM2 PARM3
COMMAND PARM3 PARM2 PARM1 

The following example shows a vertical list of parameters with a repeat symbol which includes a comma.

Separator with Repeatable Parameters
             ┌─ , ─────────┐
►►─ COMMAND ─▼─┬─ PARM1 ─┬─┴──────────────────────────────────────────────────►◄
               ├─ PARM2 ─┤
               └─ PARM3 ─┘

Some choices you can make include:

COMMAND PARM2
COMMAND PARM1,PARM2,PARM3
COMMAND PARM3,PARM2,PARM1
Default Parameters

When a parameter in a syntax diagram has a left-facing arrow, for example, YES in the following diagram, its special treatment indicates it is the default parameter. If you do not include the default parameter when you write the statement, the result is the same as if you had actually included the parameter.

Default Parameter
►►─ COMMAND ─┬──────────────────────┬─────────────────────────────────────────►◄
             ├─ PARM1= ─┬─────────┬─┤
             │          ├─ YES ◄ ─┤ │
             │          └─ NO ────┘ │
             └─ CLAUSE2 ────────────┘

Because YES is the default in the preceding example, if you write:

COMMAND CLAUSE2

You have written the equivalent of:

COMMAND PARM1=YES CLAUSE2
Variables Representing Several Parameters

In some syntax diagrams, a set of several parameters is represented by a single reference, as shown in the following example.

Variables Representing Several Parameters
►►─ COMMAND ─┬─────────────────────┬──────────────────────────────────────────►◄
             ├─ CLAUSE1 ───────────┤
             └─┤ parameter-block ├─┘

Expansion of parameter-block

├──┬─────────────────────┬─────────────────────────────────────────────────────┤
   ├─ PARM1 ─────────────┤
   └─ PARM2 ─┬─────────┬─┘
             ├─ PARM3 ─┤
             └─ PARM4 ─┘

The parameter-block variable can have its own syntax diagram.

Choices you can make from this syntax diagram therefore include (but are not limited to) the following:

COMMAND CLAUSE1
COMMAND PARM1
COMMAND PARM2 PARM4
Syntax Notes

A note in a syntax diagram is similar to a footnote except that the note appears at the bottom of the diagram box.

Syntax Note
►►─ COMMAND ─┬────────────┬───────────────────────────────────────────────────►◄
             └─ CLAUSE1¹ ─┘

¹ This is a note about the keyword.