Using Expressions
Expressions define a value that is evaluated at run time.
Simple expressions can contain:
A string or numeric constant, for example, percent or 42.
A variable name.
A built-in or user-defined BASIC function.
A complex expression can contain a combination of constants, variables, operators, functions, and other expressions.
Accessing Expressions
You can access expressions by double-clicking a Transformer Stage within a job. Next you double-click the Derivation cell for any column in a transformer link and the Expression Editor opens. You can type an expression directly into the editor, or use the menu by clicking the Suggest button on the right side.
Image: Expression Suggestion Menu
This example illustrates the Expression Suggestion Menu.
Different menus display depending on whether you right-click an input link, output link, the stage variable table, or links area background. The different menus are also dependent on what type of job you are working on (Server, Parallel, or Mainframe). The output link menu includes operations on Derivations. The input link menu includes operations on key expressions. The stage variable menu includes operations on stage variables.
Image: Expression Editor Main Menu
This example illustrates the Expression Editor Main Menu.
To insert a function in your expression, click the Suggest button and select Function. The following choices are displayed:
Image: Suggested functions
This example illustrates the Suggested functions.
Click the plus sign next to the function type to display the functions categorized under them.
Expression Editor Options
This table describes the menu options for the Expression Editor:
Expression Editor Menu Options |
Description |
---|---|
DS Macro |
Insert a built-in DataStage BASIC Macro. |
DS Function |
Insert a built-in DataStage BASIC function. |
DS Constant |
Insert a predefined constant. |
DS Routine |
Insert a routine from the repository. |
DS Transform |
Insert a transform from the repository. |
Job Parameter |
Insert a parameter. |
Input Column |
Insert an input column name. |
Link Variables |
Insert a link variable |
Stage Variables |
Insert a stage variable. |
System Variables |
Insert a system variable. |
String |
Insert a string. |
Function |
Insert a function. |
() Parentheses |
Insert parentheses. |
If Then Else |
Insert If Then Else logic into the expression. |