Go to the first, previous, next, last section, table of contents.


Defining

Equate expressions are defined using the EQUATE predefined macro. This has one argument which is the name of the equate which can be in upper or lower or mixed case and is case sensitive. The first character of the equate name should be an underscore or an alphabetic character (A--Z or a--z), the remaining characters can be these as well as the numeric characters (0--9). There is a maximum name length (see section Hard Limits). The equate definition is given within a text body on the subsequent line and continues until the text body terminates. Only one equate definition can be within the text body so it can only include the definition of one function, named by the predefined macro.

An equate that takes arguments can be defined by immediately following the name with an open bracket, comma separated list of variable names (none is allowed), and then a close bracket. Alternatively the inputs keyword can be used as described in section Calling Other Equates. Below are some examples of equate definitions (none of them have a body so none of them would do anything). The body of an equate is defined as a text body on the line immediately below the name/arguments definition.

%%EQUATE test
%%EQUATE substr(string,start_ndx,end_ndx)
%%EQUATE eval()

Note that the eval equate is commonly defined and left as void to provide a means to process equate expressions within a text body (such as a header, footer or record) where the desired equate expression is simply given as an argument in the text body and the equate itself has no affect. Note however that keywords are not recognised in this situation and therefore if operators are needed the raw reversed operator symbols must be used (see section Reversed Equate Operators).


Go to the first, previous, next, last section, table of contents.