|
jack.roughgarden@cussys.com wrote: > > Does anyone know where I can find a working example of a Mod10 > check digit routine? > Here is one that we use. You will need to use the correct # of digits for your application but mod10 itself is the same for all applications. John Hall Home Sales Co. D DIGITDS UDS D DIGT 1 11 0 D DIM(11) D OCR1 1 11 C* SETUP FIELDS FOR OCR SCAN LINE C* CALL OCRCAL TO GET DIGITS PASS - OC, RETURN VAL IN TEST C* START WITH IN93 ON C* C* MAKE OF FIRST SCAN LINE MMYY$$$$$$$ C MOVEL M MMYY C MOVE Y MMYY C MOVEL MMYY OCR1 C MOVE CUMAMT OCR1 C* MOVELOCR1 DIGT C Z-ADD 11 I 2 0 C Z-ADD 0 CHECK C Z-ADD 2 MLT 1 0 C* C LP1 TAG C MOVE DIGT(I) OC 1 0 C EXSR OCRCAL C ADD TEST CHECK 3 0 C SUB 1 I C I IFGT 0 C GOTO LP1 C END C* C* SETON H2 C* CHECK HOLDS TOTAL - FIND NEXT HIGHER MULT OF 10 & SUBR C CHECK ADD 9 CHECK1 3 0 C MOVEL CHECK1 CHECK2 2 0 C 10 MULT CHECK2 CHECK1 C CHECK1 SUB CHECK CD1 1 0 +--- | 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.