validating bank routing #'s
Kenneth Brody
kenbrody at bestweb.net
Wed Nov 8 14:09:48 PST 2006
Quoting Walter Vaughan (Wed, 08 Nov 2006 16:23:14 -0500):
> GCC Consulting wrote:
>
> > Does anyone have a routine available for validating bank routing #'s?
> >
> > Richard Kreiss
>
> First strip out any non-numeric characters (like dashes or spaces) and
> make sure the resulting string's length is nine digits,
>
> 7 8 9 4 5 6 1 2 4
>
> Then multiply the first digit by 3, the second by 7, the third by 1, the
> fourth by 3, the fifth by 7, the sixth by 1, etc., and add them all up.
>
> (7 x 3) + (8 x 7) + (9 x 1) +
> (4 x 3) + (5 x 7) + (6 x 1) +
> (1 x 3) + (2 x 7) + (4 x 1) = 160
>
> If this sum is an integer multiple of 10 (e.g., 10, 20, 30, 40, 50,...)
> then the number is valid, as far as the checksum is concerned.
>
> Now, if this were a normal developer community, someone would code that
> in filepro and post it here.
Us, "normal"? Who are you kidding? :-)
Untested code, assuming that you have validated ABA as having 9 digits:
sum = ( mid(ABA,"1","1") + mid(ABA,"4","1") + mid(ABA,"7","1") ) * "3"
sum = sum + ( mid(ABA,"2","1") + mid(ABA,"5","1") +
mid(ABA,"8","1") ) * "7"
sum = sum + ( mid(ABA,"3","1") + mid(ABA,"6","1") +
mid(ABA,"9","1") )
valid If: mod(sum,"10") = "0"
Then: ' Checksum is valid
--
KenBrody at BestWeb dot net spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com
More information about the Filepro-list
mailing list