Preprocessor Variables and Data Elements

Preprocessor local variables function like static storage, rather than automatic storage, so values are maintained across invocations of a preprocessor procedure.

Preprocessor names are formed according to the rules for other Open PL/I names.

A preprocessor variable is specified in a %DECLARE statement with the FIXED, CHARACTER, or BIT attribute. No other attributes can be declared for a preprocessor variable.

A preprocessor variable declared with the FIXED attribute is given the PL/I attribute DECIMAL and precision (5,0). Fixed decimal constants in preprocessor expressions must be integers.

A preprocessor variable declared with the CHARACTER attribute is given the PL/I VARYING attribute with certain restrictions on its length, as described elsewhere in this manual. String repetition factors are not allowed for character constants in preprocessor expressions.

For macro preprocessor variables, you can use arithmetic compound operators within macro assignment statements. The following compound operators are supported:

+= Evaluate, add and assign
-= Evaluate, subtract and assign
*= Evaluate, multiply and assign
/= Evaluate, divide and assign
For example:
%PPVAR += 1;

There are no preprocessor bit variables. However, bit constants are allowed. They are converted to their corresponding decimal value and treated as fixed constants. Only the rightmost 17 digits are used. A conversion result greater than 99999 is given that value. String repetition factors are not allowed for bit constants in preprocessor expressions.