Previous Topic: Macro VariablesNext Topic: Selection Variables


Positional Variables

Positional variables (@1. . .@9) give you the ability to replace variable symbols within a predefined (EQUATE or PF key) text string with tokens entered on the command line. Positional variables differ from macro variables in that the number (@n) is significant; i.e. @2 always refers to the second available token, and @4 always refers to the fourth. Also, because the number specifies exactly which token is referred to, that token can be used for replacement multiple times.

Suppose the following EQUATE is in effect:

EQUATE  ONRW  OBT NEXT @1 IN @2

This example behaves exactly as if the positional variables were macro variables:

Command line entry: ONRW EMP-REC &A

Executed command: OBTAIN NEXT EMP-REC WITHIN &A

Suppose the following EQUATE is in effect:

EQUATE  OLRW  OBT NEXT @1 WHERE @2 = @3 OR @2 = ZERO

This example illustrates the difference between positional and macro variables.

Command line entry: OLRW EMP-LR EMP-PAY 12.34

Executed command: OBTAIN NEXT EMP-REC WHERE EMP-PAY = 12.34 OR EMP-PAY = ZERO

Note the multiple use of @2 ( = EMP-PAY) in decoding the command.

Note: For more information on using positional variables, see Extended Command Processing and Command Processing Examples.