Use of Constants
Most of the macro function parameters can take numeric constants or expressions evaluating to a numeric constant (macro functions operating on strings can take string constants).
In macro functions performing record-by-record operations (for example, adding two numeric columns), using a constant is equivalent to specifying a column containing that constant value in each row. Essentially, when a constant is provided as an input parameter, the constant is expanded to same length as the input.
Some macro functions can take ASCII text strings and numeric constants. Parameters that can accept both numeric constants and ASCII text strings are noted in the "Parameters" section of each macro function.
Examples are provided in the following table.
Function Definition | How the Constant Is Interpreted |
---|---|
PERCENT_UTILIZ = (CURR_BAL*100)/ CREDIT_LIM |
The constant 100 is interpreted as a column
containing the same number of rows as the column CURR_BAL ,
with each row containing the constant 100 . The derived
field PERCENT_UTILIZ will contain each value of CURR_BAL
multiplied by 100 and divided by each value of CREDIT_LIM . |
NAME = STRING_CONCAT ("Mr. ", LAST_NAME) |
The constant "Mr." is interpreted
as a column containing the same number of rows as the column LAST_NAME ,
with each row containing the constant "Mr." .
The derived field NAME will contain each of the text
strings in LAST_NAME prefaced by "Mr." . |