Question & Answer
Question
What is the Mod 7 algorithm used in our application to find the check digit for Pro Number ?
Answer
This is the current mod-7 calculation logic that we have in our product :
Step 1 : 2 *(unit's place digit + 100th place digit + 10000 place digit) + (10th place + 1000th place + 100000th place digit)
Step 2 : Divide the above result by 10
Step 3 : Substract the remainder from 10
Mod-7 Check digit is then inserted at the end of the 8-digit number, which will then have 9-digits
The result from step 3 is the Mod-7 check digit
eg. Consider 57833107
Step 1 : 2 *(7 + 1 + 3) + (0 + 3 + 8) = 22 + 11 = 33
Step 2 : 33/10 = .3 Reminder = 3
Step 3 : 10 - 3 = 7
Resulting Check Digit = 7
Another algorithm that is commonly used but is NOT the out of the box definition of Mod7 algorithm is:
Step 1 : Divide the 8-digit number by 7
Step 2 : Multiply the remainder by 7. The remainder is the single digit number after the period. If more than one digit appears as the remainder use only the first digit;
Step 3 : Round up that answer to the next whole number.
Mod-7 Check digit is then inserted at the end of the 8-digit number, which will then have 9-digits
The result from step 3 is the Mod-7 check digit
eg. Consider 57833107
Step 1 : 57833107/7 = 8261872.428
Step 2 : .4 * 7 = 2.8
Step 3 : 2.8 rounded up to the next whole digit is 3
Resulting Check Digit = 3
If customer wants to use a Mod 7 algorithm which is different from what is provided Out of the box then this can be defined in the YDMComputeCheckDigitUE User Exit
Note : Similar difference can also be seen in the Mod 10 algorithm. Please refer to Technote 1617068 for the details.
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21977886