| |
Validation checks
| Presence check |
Certain fields such as customer number, item code,
quantity etc must be present. |
Format check
(also called picture
check) |
e.g. code may have a pattern of 2 letters followed by 4 numbers.
The quantity and price must be numeric. |
| Range check |
A card expiry date must have a month number between 1 and 12, and
date must be after today |
| File lookup check |
If the customer has filled in their customer number, the computer
can look this up on the customer file and display the name and address. The
data entry operator can check that it tallies. |
Check digit check. |
The last digit(s) is calculated from the earlier ones
the maths is redone to see it all tallies. (see setail below) |
Batch header checks |
Total number of records in the batch should be
calculated by the computer and compared with the figure on the batch header.
The control totals and hash totals are also calculated and compared. |
Check digits
Code numbers such as a customer no., employee no. or product no. are
often lengthy and prone to error. One way of preventing these errors is to add
an extra digit to the end of a code number which has been calculated from the
digits of the code number. In this way the code number with its extra check
digit is self-checking.
Best-known method of calculating check digits is the modulus-11 system,
which traps over 99% of all errors.
- Each digit of the code number is assigned a weight. The
right hand (least significant) digit is given a weight of 2, the next digit to
the left 3 and so on.
- Each digit is multiplied by its weight and the products added
together.
- The sum of the products is divided by 11 and the remainder obtained.
- The remainder is subtracted from 11 to give the check digit. The two
exceptions are:
- If remainder is 0, check digit is 0, not 11
- If remainder is 1, check digit is X, not 10
Example: You will not be asked to recall this example so don't learn it.
To calculate the check digit for the number 1587:
- Original code number 1 5 8 7
- Weights 5 4 3 2
- Multiply digit by its weight 5 20 24 14
- Add products together 5 + 20 + 24 + 14 = 63
- Divide by 11 5 remainder 8
- Sub remainder from 11 11 - 8 =3
Check digit = 3. Complete code number is 15873.
To check that a code number is valid, it is not necessary to recalculate
the check digit completely. If the check digit itself is assigned a weight of
1, and the products of the digits (including the check digit) and their
respective weights are calculated, their sum will be divisible by 11 if the
check digit is correct.
|