Value Returned Expressions
A value returned expression is an expression that evaluates to a specific value. For example, a function that calculates the sum of two numbers may return the sum of those numbers as a value. You can then use this value in other parts of the program.
Value-Returned Expression List: A comma-separated list of value-returned expressions.
value_returned_expression_list ::= value_returned_expression [,value_returned_expression]...Value-Returned Expression
value_returned_expression ::= term | value_returned_expression {'+'|'-'} term
term ::= factor | term {'*'|'/'} factor
factor ::= ['+' | '-'] primary
primary ::= column_reference
| constant_value
| PARAMETER '[' parameter_name ']'
| case_expr
| function_expression
| '('value_returned_expression ')'
column_reference ::= { THIS | table_name }.column_name // E.g.: CUST.CUST_ID,
THIS.AMT (Refer to a previously defined column within the same target dataset)
| table_name [EXCLUDE] column_list // E.g.: sales[amount, quantity, prod_id],
sales[amount] , sales EXCLUDE [amount, quantity, prod_id]
constant_value ::= [-] number | identifier | date | timestamp | string| NULLExample
IMPORT SOURCE CUSTOMERS
DEFINE DATASET CUSTOMERS_D
ROWSOURCE CUSTOMERS;
THIS = CUSTOMERS[CUST_ID];
// value_returned_expression - use of function CONCAT_WS with column_reference
THIS[CUST_FULL_NAME] = CONCAT_WS(' ', CUSTOMERS.CUST_FIRST_NAME,CUSTOMERS.CUST_LAST_NAME);
END