HP Data Entry and Forms Management System (VPLUS) Reference Manual (32209-90024)
Chapter 4 151
Advanced Forms Design
CHECK DIGIT
CHECK DIGIT
Used to test the check digit in a numeric or alphanumeric field (modulus 10 or 11).
Syntax
[CDIGIT {11
10} ["
message
"]]
Parameters
message
Specifies a custom error message.
Discussion
Check digit verification is a special check on a numeric or alphanumeric field in which the
last (rightmost) character is a check digit. Verification can be either modulus 10 or
modulus 11. (You can use REFSPEC, as described in Section 5, to add a check digit to an
existing field value in a batch file.)
Modulus checks are used when the risk of error keying in numbers must be reduced to a
minimum. Depending on the modulus selected, single digit errors, and single or double
transpositions can be checked using a check digit. Modulus 10 detects single transpositions
and incorrect keying of a single digit. Modulus 11 detects these, plus double transpositions.
(Refer to Appendix D for an exact description of the modulus 10 and 11 checks.)
In general, a check digit is arrived at by performing calculations on a number and then
using the result of these calculations as the final digit or "check digit" in that number. For
example, suppose a 5-digit charge account number is to be assigned to a new account. The
specified calculations (modulus 10 or 11) are performed on the 5-digit number, the result is
added as a check digit to the number, and a 6-digit number is assigned as the new account
number.
Thereafter, when this number is keyed in and the CDIGIT edit test is selected, then the last
digit is checked against the same calculations. If the number was keyed incorrectly, an
error is diagnosed.
Note that a number derived using modulus 10 calculations can only be checked by CDIGIT
10, and a number derived using modulus 11 can only be checked by CDIGIT 11.
Letters of the alphabet can be checked by either a modulus 10 or 11 check. Digits are
assigned to the letters so they can be treated like numbers. Thus a field with a check digit
can contain a mix of numbers and letters, but must not contain any special characters. Any
initial plus or minus sign is ignored.