This rule validates the length of the specified field value against the length you specify. You can validate against a range “greater than or equal to” or “less than” the given length. Used alone for the Data Cleanser, this rule rejects records containing field values that fail the validation. You can also use this rule with conditional rules and operators to define more complex rules. When used in a constrained analysis for the Data Profiler, the frequency report is generated for all records for which the data length rule is true.
The syntax for dataLength is:
<dataLength fieldName="name" len="length" more="true/false"/> |
The parameters for dataLength are:
fieldName – The qualified field name or assigned variable for the field to validate.
len – The length to use to validate the field value.
more – An indicator of whether to consider lengths that are greater than or equal to the length or that are less than the length. Specify “true” if the field value should be greater than or equal to the specified length. Specify “false” if the field value should be less than the specified length.
This sample defines a rule to check for records containing first names that are 30 or more characters and containing last names that are shorter than two characters.
<rule> <dataLength fieldName="Person.FirstName" len="30" more="true"/> <datalength fieldName="Person.LastName" len="2" more="false"/> </rule> |