Boolean Returned Expressions

Boolean returned expressions evaluate to TRUE or FALSE based on logical conditions.

Boolean returned expressions include:
  • value_returned_expression { '>=' | '<=' | '>' | '<' | '<>' | '=' } value_returned_expression: Compares two expressions using operators (>=, <=, >, <, <>, =).
    Example:
    CUSTOMERS.CUST_YEAR_OF_BIRTH >= 2000
  • expression [NOT] BETWEEN value_returned_expression AND value_returned_expression: Checks if the value of the expression falls within the specified range.
    Example:
    CUSTOMERS.CUST_CREDIT_LIMIT BETWEEN 50000 AND 100000
  • match_expression [NOT] LIKE pattern: Matches a string match expression against a specified pattern with the following valid wildcard characters (%, _, [], [^]).
    • match_expression: A string that's evaluated against a pattern.
    • pattern: A string specifying the pattern for matching with valid wildcard characters: %, _, [], [^].
    Example:
    CUSTOMERS.FIRST_NAME LIKE 'J%n'
  • expression IS [NOT] NULL: Checks if the expression is (or is not) NULL.
    Example:
    CUSTOMERS.CUST_EMAIL IS NOT NULL
  • ISNULL '(' expression ')': Returns as True if the expression is Null, or is False otherwise.
    Example:
    ISNULL(CUSTOMERS.CUST_VALID)
  • NOT boolean_returned_expression: Negates a boolean expression.
    Example:
    NOT CUSTOMERS.CUST_YEAR_OF_BIRTH >= 2000
  • boolean_returned_expression AND boolean_returned_expression: Combines conditions using the logical AND.
    Example:
    CUSTOMERS.CUST_YEAR_OF_BIRTH >= 2000 AND CUSTOMERS.CUST_EMAIL IS NOT NULL
  • boolean_returned_expression OR boolean_returned_expression:Combines conditions using the logical OR.
    Example:
    CUSTOMERS.CUST_YEAR_OF_BIRTH >= 2000 OR CUSTOMERS.CUST_EMAIL IS NOT NULL
  • expression [NOT] IN in_expr: Checks if the value of the expression exists (or doesn't exist) in the list of in_expr values (value returned expression list).
    Example:
    CUSTOMERS.CUST_VALID IN ('A', 'I')
  • '('boolean_returned_expression')': Groups expressions for logical evaluation.
    Example:
    (CUSTOMERS.CUST_YEAR_OF_BIRTH >= 2000 AND CUSTOMERS.CUST_EMAIL IS NOT NULL)
Usage Example
DEFINE VERSIONED DATASET CUSTOMERS_D      
   //use of boolean_returned_expression
   ROWSOURCE CUSTOMERS WHERE CUSTOMERS.CUST_YEAR_OF_BIRTH IS NOT NULL AND CUSTOMERS.CUST_SRC_ID IS NULL;
   THIS = CUSTOMERS;
   PRIMARYKEY[CUST_ID];
END