The $DEFINE directive supplies replacement text for a symbol and defines a symbol used to control the compilation of the program.
$DEFINE identifier {replacement-text}
identifier | Specifies the symbol to be defined. |
replacement-text | Specifies a string of characters that the compiler uses to replace each occurrence of the symbol in the current program. The replacement-text parameter is terminated by a RETURN. |
When used to replace symbol text, the specified identifier and any associated replacement text is added to the symbol table. Every occurrence of the symbol following the $DEFINE directive is replaced by the replacement text. If no replacement text is specified, the symbol is defined with a value of null.
Example 1
TEST. DEF
001 $DEFINE GREETINGS PRINT TIMEDATE();PRINT 'Hello' 002 GREETINGS
Example 2
PLATFORM
001 $DEFINE PLATFORM.D3