CHECK10
ANSI
The CHECK10 instruction (which may be abbreviated as CK10) performs a modulo 10 check digit calculation on two strings. The instruction uses the following format:
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
base
Required. A Character String Variable that contains the base number and the check digit.
sep
Required. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, or INTO.
weight
Required. A Character String Variable or string Literal that contains the weight factor.
digit
Optional. A Character String Variable that contains the calculated check digit that is returned.
Flags Affected: OVER, ZERO
Note the following:
If {digit} is specified, it must be separated from {weight} by a comma.
{base} and {weight} remain unchanged.
If variable is null or contain non-digits or the Logical Length of the base number is not equal to the Logical Length + 1 of the weighing factor, the OVER Condition Flag is set and the EQUAL Condition Flag is cleared. If {digit} was specified, it is blank filled.
If the check digit computes, the EQUAL Condition Flag is set. Otherwise, the OVER Condition Flag is set. In case, if {digit} was specified, it contains the correct check digit.
Lateral addition computes the check digit.
See Also: Example Code, CHECK11, Mathematical Instructions
![]() |