Call a Macro

To call a macro, use the following syntax where you want the macro to run within the parameter file.

Syntax

[target =] macro_name (val[, ...])
[target =] macro_name (val | {val, val, ...}[, ...])

Table 11-19 Syntax Elements for Calling a Macro

Argument Description

target =

Optional. Specifies the target to which the results of the macro are assigned or mapped. For example, target can be used to specify a target column in a COLMAP statement. In the following call to the #make_date macro, the column DATECOL1 is the target and will be mapped to the macro results.

DATECOL1 = #make_date (YR1, MO1, DAY1)

Without a target, the syntax to call #make_date is:

#make_date (YR1, MO1, DAY1)

macro_name

The name of the macro that is being called, for example: #make_date.

( val[, ...])

The parameter input values. This component is required whether or not the macro defines parameters. If the macro defines parameters, specify a comma-separated list of input values, in the order that corresponds to the parameter definitions in the MACRO parameter, and enclose the list within parentheses. If the macro does not define parameters, specify the open and close parentheses with nothing between them ().

( val | {val, val, ...} )[, ...]

The parameter input values. This component is required whether or not the macro defines parameters. If the macro defines parameters, specify a comma-separated list of input values, in the order that corresponds to the parameter definitions in the MACRO parameter, and enclose the list within parentheses. To pass multiple values to one parameter, separate them with commas and enclose the list within curly brackets. If the macro does not define parameters, specify the open and close parentheses with nothing between them ().

See the following topics to learn more about syntax for calling a macro: