|
>Does anyone know where I can find a working example of a Mod10 check digit routine?< Don't have a working example, but the details are found in the "SDA Users Guide and Reference for the System/36 Environment" (SC09-1893-00): 2.4.7.1 Modulus 10 To determine the modulus 10 self-check digit, disregard the farthest right digit and do the following calculation on the remaining digits: 1. Multiply the unit position and every alternate position of that number by 2. 2. Add the digits in the products to the digits in the number that were not multiplied in step 2. 3. Subtract the sum from the next higher number ending in 0. The difference is the self-check digit. Compare this digit with the farthest right digit of the input field. If those digits are the same, the self-check digit is successful. For example, if you specify modulus 10 self-checking for an input field and the operator types 436188: Number to be self-checked 4 3 6 1 8 New farthest right position and 4 6 8 every alternate position Multiply by 2 8 12 16 Digits not multiplied 3 1 Add 8 + 3 + 1 + 2 + 1 + 1 + 6 = 22 Next higher number 30 ending in 0 Subtract 30 - 22 = 8 Self-check digit 8 The self-check digit matches the farthest right digit of the entered number. +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.