Functions
Enrichment includes an extensive set of functions that allow you to manipulate data from your inputs and return the result as a variable value. Enrichment also allows calls to user-written functions.
There are four types of functions: logical, string, numeric, and command.
- Logical functions return
TRUE (1)
orFALSE (0)
. - String functions return a string of characters.
- Numeric functions return a numeric value.
- Command functions are used to reference Enrichment functions that do not return a value. The following example shows the WRITE function which returns no value:
WRITE(DD:EXCEPTIO, %%RECORD, F, 132)
For compatibility with previous releases of EnrichmentEnrichment, function statements can also be referenced in a set statement. For example:
%%X = WRITE(DD:EXCEPTIO, %%RECORD, F, 132)
The variable on the left side is set to a null string.
The most commonly used functions include:
- CHANGED indicates whether a variable value has changed from the previous document to the current one.
- FOUND indicates whether a particular field was found in the document during Enrichment processing.
- JUSTIFY returns a string aligned within a specified number of characters.
- LOOKUP returns the record that satisfied the lookup criteria.
- SUBSTR returns a portion of a string.