Structure of Conditional Statements - trillium_discovery - trillium_quality - 17.2

Trillium Control Center

Product type
Software
Portfolio
Verify
Product family
Trillium
Product
Trillium > Trillium Quality
Trillium > Trillium Discovery
Version
17.2
Language
English
Product name
Trillium Quality and Discovery
Title
Trillium Control Center
First publish date
2008
Last updated
2024-07-01
Published on
2024-07-01T08:56:48.630530

The conditional statement is an IF/ELSE clause that tells the Transformer how to process data. IF statements set conditions that are defined using attribute names, operators, functions, and attribute values. To specify an action within the condition, use RUN/SET statements. Always close an IF statement with ENDIF.

Keyword

The following table lists the keywords in the conditional statements.

Keyword Description
IF (Required) Begins a statement. When conditions are True, the RUN/SET statements following the IF keyword are executed.
ELSEIF (Optional) When IF conditions are False, the ELSEIF condition is evaluated.
ELSE (Optional) When IF or ELSEIF conditions are False, the RUN/SET statements following the ELSE keyword are executed.
RUN (Optional) Precedes action commands.
SET

(Optional) Precedes assignment commands.

ENDIF (Required) Closes a conditional statement.

IF/ELSE/ENDIF Syntax

Use the following IF/ELSE/ENDIF syntax to build a conditional statement. You create a condition using the operators and functions.

Note: An IF condition must be defined as a test within parentheses. The maximum number of IF statements for each settings file is 4000. There is a maximum of 100 nested IFs allowed in each IF statement. Adding multiple IF keywords to the top level of a single conditional section is not supported. Include only one top-level IF (head-if) per section.

where function1 through function4 indicate the action to perform. IF statements can also be nested as shown below:

RUN Statements

The RUN statements specify a function to perform. When the condition is True, the RUN statements following IF are executed. When the condition is False, the RUN statements following ELSEIF and/or ELSE are executed. The valid functions for the RUN statements are CHARACTER_TRANSLATION, FIELD_SCANNING, and TABLE_RECODING.

Note: The maximum number of RUN statements for each IF statement is 500.

The RUN statement is defined by:

  • Function names or subroutines as defined in the settings file
  • Entry ID (list of entries) to be executed. When you call multiple functions, use hyphens to indicate ranges or commas to separate items and run them in sequence. Example: RUN TABLE_RECODING(3-5), RUN FIELD_SCANNING(1,6)

SET Statements

The SET statements specify an assignment to complete. When the condition is True, the SET statements following IF are executed. When the condition is False, the SET statements following ELSEIF and/or ELSE are executed.

Note: Attributes used in SET statements cannot contain a parenthesis.

The SET statement takes the following as arguments:

  • Schema attribute names
  • Equal sign assignments operator (=)
  • Value or attribute data arithmetic

Example