Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MOD 10 or MOD 11 Self Check Digit
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00114893
Message ID:
00114921
Views:
15
Kirk,

Usually check digits are the sum of each digit of the rest of the number modulo some other number. Do you have some sample valid numbers to test your code against?

pat no = 765432
7+6 = 13, 13 mod 10 = 3
3 + 5 = 8, 8 mod 10 = 8
8 + 4 = 12, 12 mod 10 = 2
2 + 3 = 5, 5 mod 10 = 5
5 + 2 = 7, 7 mod 10 = 7

so your final value would be 7654327

store your patient number as a character field and just use substr(), val() and % to process each digit.

>Our system has to create an ascii batch file to send data to another system. That system defines the first field of the record (PATNO) as Numeric with a length of 7. The PATNO itself is 6 digits followed by either a MOD 10 or MOD 11 self check digit. I've never done any of that, so I am hoping for some pointers on how I do a MOD 10/11 check digit. Is it a routine I run on the 6 digit number? Any help greatly appreciated.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform