DataFlux Data Management Studio 2.6: User Guide
You can use the getvar() and setvar() functions to dynamically retrieve and set macro variables in an expression.
In the sample job shown above, Data Source 1 specifies a source table. The Expression 1 node specifies the following expression:
string value_of_macro_var
value_of_macro_var = getvar("MIGRATION_MACROVAR1", "MIGRATION_MACROVAR1 not defined!")
The first line adds a new column, value_of_macro_var, to the output table for the Expression 1 node. The second line uses the getvar() function to retrieve a value that is specified in a macro variable that is called MIGRATION_MICROVAR1. If MIGRATION_MICROVAR1 does not have a value, the expression returns an error message.
In order to focus on how macro variables are created and how they can be referenced in an expression, assume that the job flow above has been created, and that only the following tasks remain:
It is assumed that you are familiar with the getvar() and setvar() functions. For more information about these functions, see "Using getvar() and setvar()" in the DataFlux Expression Language Reference Guide.
The easiest way to add a macro variable definition is to use the Macro Files folder in the Administration riser. Macro variable definitions added here are stored in the macros.cfg file in your user profile directory by default. Perform the following steps:
MIGRATION_MACROVAR1=3
For the current example, assume that the following job flow has been created and is open in the data job editor.
Perform the following steps to add an expression with a getvar() function.
You can confirm that the macro variable worked by running the job. Perform the following steps:
Documentation Feedback: yourturn@sas.com
|
Doc ID: dfU_T_Macros_Expression.html |