9.17 CHECKSTRING
Þ Note: Built-In Function Rules.
Checks a string contains only allowable characters.
For use with
|
Arguments
|
Return Values
|
Technical Notes
Alpha fields always contain trailing blanks up to the length of the field. These trailing blanks need to be considered if you use Alpha fields when using this BIF. If trailing blanks are permitted in the String to be checked, then a blank must be provided in the list of allowable characters.
A literal may be used for the List of allowable characters.
If an Alpha field is used for the List of allowable characters, it may contain trailing blanks. For example
USE BUILTIN(CHECKSTRING) WITH_ARGS(#STRING #ALLOW) TO_GET(#YN)
If #ALLOW is Alpha(2) with a value of 'A ', then characters A and blank are checked for in #STRING.
If #ALLOW contains 'AB', only characters A and B are checked for in #STRING. Any trailing blanks in #STRING will result in a return code of N (contains other characters).
Reminder - in RDMLX you may:
- Use the intrinsic .Trim on the Built-In Function arguments to trim trailing blanks from field values.
- Replace the CHECKSTRING Built-In Function with the ContainsOnly intrinsic. This intrinsic treats trailing blanks in Alpha fields as insignificant and handles DBCS characters.
- Use fields of type String