LENGTH |
Scroll |
The LENGTH function returns the length of a character text string.
Category
String
Syntax
LENGTH(data_string)
Parameter Descriptions
data_string - This parameter specifies the name of a character text data string. This data string can be a field from a source datastore, a variable or the result of another Function.
Example
the length of source field SRC_FLD1 into target field LEN_FLD1. Assume that the length of the source field is 18.
LEN_FLD1 = LENGTH (SRC_FLD1)
Returns the value 18 and maps the result to the target field.
Examine the length of source field SRC_FLD1. If the length is less than 5, map it to target field TGT_FLD1 unchanged. Otherwise, map only the first 4 bytes into TGT_FLD1.
IF LENGTH(SRC_FLD1) < '5'
{
TGT_FLD1 = SRC_FLD1
}
ELSE
{
TGT_FLD1 = LEFT(SRC_FLD1, 4)
}