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, variable.
Required Keywords and Variables
Appear on a main line.
Optional Keywords and Variables
Appear below a main line.
Default Keywords and Variables
Appear above a main line.
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 |
The following is an example of a statement without parameters.
Statement Without Parameters ►►─ COMMAND ──────────────────────────────────────────────────────────────────►◄
You must write:
COMMAND
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' ─────────────────────────────────────►◄
If the word "variable" is a valid entry, 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 one entry is required and only one of the displayed parameters is allowed in the statement.
Choice of Required Parameters
►►─ COMMAND ─┬─ PARM1 ─┬──────────────────────────────────────────────────────►◄ ├─ PARM2 ─┤ └─ PARM3 ─┘
You can choose one of the parameters from the vertical list, such as in the following examples:
COMMAND PARM1
COMMAND PARM2
COMMAND PARM3
When a required parameter in a syntax diagram has a default value, it indicates the value for the parameter if the command is not specified. If you specify the command, you must code the parameter and specify one of the displayed values.
Default Value for a Required Parameter
►►─ COMMAND ─ PARM1= ─┬─ YES ◄ ─┬─ PARM2 ─────────────────────────────────────►◄ └─ NO ────┘
If you specify the command, you must write one of the following:
COMMAND PARM1=NO PARM2
COMMAND PARM1=YES PARM2
A single optional parameter appears below the horizontal line that marks the main path.
Optional Parameter
►►─ COMMAND ─┬─────────────┬──────────────────────────────────────────────────►◄ └─ PARAMETER ─┘
You can choose (or not) to 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 ─┬─────────┬──────────────────────────────────────────────────────►◄ ├─ PARM1 ─┤ └─ PARM2 ─┘
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 PARM1
COMMAND PARM2
For some statements, you can specify 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. The following examples include the repeat symbol.
Repeatable Variable Parameter
┌────────────┐ ►►─ COMMAND ─▼─ variable ─┴───────────────────────────────────────────────────►◄
In the above example, the word "variable" is in lowercase italics, indicating that it is a value you supply, but it is also on the main path, which means that you are required to specify at least one entry. The repeat symbol indicates that you can specify a parameter more than once. Assume that you have three values named VALUEX, VALUEY, and VALUEZ for the variable. Some of your choices are:
COMMAND VALUEX
COMMAND VALUEX VALUEY
COMMAND VALUEX VALUEX VALUEZ
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 ─ ( ─▼─ variable ─┴─ ) ───────────────────────────────────────────►◄
In the above example, the word "variable" is in lowercase italics, indicating that it is a value you supply. It is also on the main path, which means that you must specify at least one entry. The repeat symbol indicates that you can specify more than one variable and that you must separate the entries with commas. The parentheses indicate that the group of entries must be enclosed within parentheses. Assume that you have three values named VALUEA, VALUEB, and VALUEC for the variable. Some of your choices are:
COMMAND (VALUEC)
COMMAND (VALUEB,VALUEC)
COMMAND (VALUEB,VALUEA)
COMMAND (VALUEA,VALUEB,VALUEC)
The following example shows a list of parameters with the repeat symbol.
Optional Repeatable Parameters
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ►►─ COMMAND ─▼─┬─────────┬─┴─▼─┬─────────┬─┴─▼─┬─────────┬─┴──────────────────►◄ └─ PARM1 ─┘ └─ PARM2 ─┘ └─ PARM3 ─┘
Some choices you can make include:
COMMAND PARM1
COMMAND PARM1 PARM2 PARM3
COMMAND PARM1 PARM1 PARM3
When a parameter in a syntax diagram is above the line, for example, YES in the following diagram, its special treatment indicates it is the default value for the parameter. If you do not include the parameter when you write the statement, the result is the same as if you had actually specified the parameter with the default value.
Default Value for a Parameter
►►─ COMMAND ─┬──────────────────────┬─ PARM2 ─────────────────────────────────►◄ └─ PARM1= ─┬─ YES ◄ ─┬─┘ └─ NO ────┘
Because YES is the default in the example above, if you write:
COMMAND PARM2
you have written the equivalent of:
COMMAND PARM1=YES PARM2
In some syntax diagrams, a set of several parameters is represented by a single reference, as in this example:
Variables Representing Several Parameters
►►─ COMMAND ─┬─────────────────────┬──────────────────────────────────────────►◄ ├─ PARM1 ─────────────┤ └─┤ parameter-block ├─┘
Expansion of parameter-block
├──┬─────────────────────┬─────────────────────────────────────────────────────┤ ├─ PARM2 ─────────────┤ └─ PARM3 ─┬─────────┬─┘ ├─ PARM4 ─┤ └─ PARM5 ─┘
The "parameter-block" can be displayed in a separate syntax diagram.
Choices you can make from this syntax diagram therefore include (but are not limited to) the following:
COMMAND PARM1
COMMAND PARM3
COMMAND PARM3 PARM4
Note: Before you can specify PARM4 or PARM5 in this command, you must specify PARM3.
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 ─┬──────────┬─────────────────────────────────────────────────────►◄ └─ PARM1¹ ─┘
¹ This is a note about the item.
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |