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:

 

 

[label]

CHECK10

{base}{sep}{weight}[,{digit}]

 

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:

  1. If {digit} is specified, it must be separated from {weight} by a comma.

  2. {base} and {weight} remain unchanged.

  3. 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.

  4. 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.

  5. Lateral addition computes the check digit.

 

 

See Also: Example Code, CHECK11, Mathematical Instructions

 



PL/B Language Reference CALC CHECK11