Railroad Diagram Examples with Sample Input

The following examples show five railroad diagrams and possible command and statement constructions based on the paths of these diagrams:

Example 1

<lock statement>

── LOCK ── ( ── <file identifier> ── ) ────────────────────────────────┤

Sample Input

Explanation

LOCK (FILE4)

LOCK is a constant and cannot be altered. Because no part of the word appears in boldface, the entire word must be entered.

The parentheses are required punctuation, and FILE4 is a sample file identifier.

Example 2

<open statement>

── OPEN ─┬───────────┬─<database name>─────────────────────────────────┤
         ├─ INQUIRY ─┤
         └─ UPDATE ──┘

Sample Input

Explanation

OPEN DATABASE1

The constant OPEN is followed by the variable DATABASE1, which is a database name.

The railroad diagram shows two user-selected items, INQUIRY and UPDATE. However, because an empty path (solid line) is included, these entries are not required.

OPEN INQUIRY DATABASE1

The constant OPEN is followed by the user-selected constant INQUIRY and the variable DATABASE1.

OPEN UPDATE DATABASE1

The constant OPEN is followed by the user-selected constant UPDATE and the variable DATABASE1.

Example 3

<generate statement>

── GENERATE ──<subset>── = ─┬─ NULL ──────────────────────┬────────────┤
                            └─<subset>─┬──────────────────┤
                                       ├─ AND ─┬─<subset>─┘
                                       ├─ OR ──┤
                                       ├─ + ───┤
                                       └─ ─ ───┘

Sample Input

Explanation

GENERATE Z = NULL

The GENERATE constant is followed by the variable Z, an equal sign (=), and the user-selected constant NULL.

GENERATE Z = X

The GENERATE constant is followed by the variable Z, an equal sign, and the user-selected variable X.

GENERATE Z = X AND B

The GENERATE constant is followed by the variable Z, an equal sign, the user-selected variable X, the AND command (from the list of user-selected items in the nested path), and a third variable, B.

GENERATE Z = X + B

The GENERATE constant is followed by the variable Z, an equal sign, the user-selected variable X, the plus sign (from the list of user-selected items in the nested path), and a third variable, B.

Example 4

<entity reference declaration>

                     ┌◄────────────────── , ─────────────────┐
── ENTITY REFERENCE ─┴─<entity ref ID>── ( ──<class ID>── ) ─┴─────────┤
                                       

Sample Input

Explanation

ENTITY REFERENCE ADVISOR1 (INSTRUCTOR)

The required item ENTITY REFERENCE is followed by the variable ADVISOR1 and the variable INSTRUCTOR. The parentheses are required.

ENTITY REFERENCE ADVISOR1 (INSTRUCTOR), ADVISOR2 (ASST_INSTRUCTOR)

Because the diagram contains a loop, the pair of variables can be repeated any number of times.

Example 5

   ── PS ── MODIFY ────────────────────────────────────────────────────►
       ┌◄───────────────────── , ────────────────────┐
   ►─┬─┴─┬─<request number>────────────────────────┬─┴─┬───────────────►
     │   └─<request number>── ─ ──<request number>─┘   │
     └─ ALL ─┬─────────────────────────────────────────┤
             └─ EXCEPTIONS ────────────────────────────┘
   ►─┬───────────────────────────────────────┬─────────────────────────┤
     │ ┌◄──────────────── , ───────────────┐ │
     └─┴─┬─────┬─<file attribute phrase>─┬─┴─┘
         ├─ ─ ─┘                         │
         ├─────┬─<print modifier phrase>─┘
         └─ ─ ─┘
  

Sample Input

Explanation

PS MODIFY 11159

The constants PS and MODIFY are followed by the variable 11159, which is a request number.

PS MODIFY 11159,11160,11163

Because the diagram contains a loop, the variable 11159 can be followed by a comma, the variable 11160, another comma, and the final variable 11163.

PS MOD 11159–11161 DESTINATION = "LP7"

The constants PS and MODIFY are followed by the user-selected variables 11159–11161, which are request numbers, and the user-selected variable DESTINATION = "LP7", which is a file attribute phrase. Note that the constant MODIFY has been abbreviated to its minimum allowable form.

PS MOD ALL EXCEPTIONS

The constants PS and MODIFY are followed by the user-selected constants ALL and EXCEPTIONS.