Previous Topic: Extended Command ProcessingNext Topic: Commands Summary


Creating Executable Commands

Use these steps to create an executable command:

  1. Determine "raw" command text
  2. Expand all levels of EQUATE phrases
  3. Substitute variable symbols
Step 1: Determine "Raw" Command

There are 3 possible command entry combinations:

Note: This also provides one of the techniques for assigning (and clearing) text to a PF key; i.e., enter text on the command line and press the desired PF key. Another method of changing PF key associates is by using the SHOW PFKEYS command to access the PF Keys Display screen.

Step 2: Expansion of All Levels of EQUATE Phrases

The raw command created above is scanned for any words which have been EQUATEd to phrases. All such words are expanded. If any words within the expanded text present EQUATE phrases, they also are expanded -- until no further expansion is possible.

Step 3: Substitution for Variable Symbols

The final step in preparing an executable command is the resolution of any symbols requiring variable substitution contained in the raw command text. Note that there are four categories of variable symbols-only two of which are resolved at this time:

CA IDMS DMLO replaces variable symbols by tokens which appear at the end of the raw command text. The number and placement of those tokens which are necessary to create a valid command depend on the type of variables which appear in the raw command.

MACRO Variable Processing

CA IDMS DMLO processes MACRO variables such that the first "&" variable, regardless of its number, receives the first token available. The second "&" variable, again regardless of its number, receives the second available token. For example, CA IDMS DMLO processes the following raw commands identically:

OBT NEXT &1 IN &2  VENDOR  VENDOR-AREA
OBT NEXT &4 IN &5  VENDOR  VENDOR-AREA

The resultant command in both cases would be:

OBT NEXT VENDOR IN VENDOR-AREA

Note: Use of "&" variables precludes multiple use of a token in a command. That is, the appearance of &1 twice in a command is always regarded as a requirement for two different tokens to be substituted rather than for a single token in two places.

Positional Variable Processing

Use of positional variables, on the other hand, provides a direct correlation between the number of the "@" variable, and the position of the token available of substitution. That is, the appearance of @4 within a raw command requires that there be at least four tokens for use in replacing "@" variables. Also, because the variable number and the position of the replacement are fixed, the same variable can be used more than once. Consider the following raw command example:

OBT FIR LR-VENDOR WHERE @1 = @2 OR @1 = @3 VENDOR-ID 123 456

The resultant command is:

OBT FIR LR-VENDOR WHERE VENDOR-ID = 123 OR VENDOR-ID = 456
Combining "&" and "@" Variables

Both types of variable symbols can appear in the same raw command. In this case, tokens associated with "&" symbols must precede tokens associated with "@" symbols. For example:

OBT FIR &1 WHERE @1 = @2 or @1 = @3 LR-VENDOR VENDOR-ID 123 456

would be interpreted as follows:

OBT FIR LR-VENDOR WHERE VENDOR-ID = 123 OR VENDOR-ID = 456