CHECK10 Example


Example:

 

  

CHECK10

BASENBR TO WTFACTR,CHKDIG(3)

 

 

Variable

PL

FP

LP

Contents

Before:

BASENBR

4

1

4

8649

 

WTFACTR

3

1

3

212

 

CHKDIG(3)

1

1

1

x

 

After:

CHKDIG(3)

1

1

1

9

 

BASENBR and WTFACTR remain unchanged.

 

The EQUAL Condition Flag is set.

 

The computation is as follows:

 

     2 times 8 = 16 (lateral addition 1 + 6) = 7

     1 times 6 = 6

     2 times 4 = 8

     7 + 6 + 8 = 21

     21 / 10 = 2 with a remainder of 1

     C = 10 - 1 = 9 (computed check digit)

 

 



PL/B Language Reference CHAIN Example CHECK11 Example