Or a 64 bit integer.

----- Original Message ----- 
From: "James Bentley" <[email protected]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Thursday, May 02, 2013 5:36 AM
Subject: [RBASE-L] - Re: European IBAN (International Bank Account Number) 
check digit calculation


Tony,

The following Wikipedia article has a section on computing the mod if a 
computer language cannot handle 30 digit integers.
http://en.wikipedia.org/wiki/International_Bank_Account_Number

Per RBase V9.1 64 bit or V9.5 64 bit documentation, the BIGNUM data type can 
hold the derived integer.
>From the Wikipedia article you can enter set var d bignum (30,0) = 
3214282912345698765432161182
Show var:
Variable = Value Type
-------------------- ------------------------------ -------
#DATE = 05/02/2013 DATE
#TIME = 4:14:02 TIME
#PI = 3.14159265358979 DOUBLE
SQLCODE = 0 INTEGER
SQLSTATE = 00000 TEXT
#NOW = 05/02/2013 4:14:02 DATETIME
d = 3214282912345698765432161182 BIGNUM (30, 0)

you are correct that the mod function does not handle BIGNUM as a valid data 
type
R>set var dy integer = (mod(.d,97))
-ERROR- Unrecognized command - retype it ( 40)

Certainly, an enhancement request to add BIGNUM as acceptable argument for 
MOD function would be in order.
In the meantime you could used the method described in the Wikipedia article 
to create a Stored Procedure (function)
to process the number in parts.




Jim Bentley,
American Celiac Society
1-504-737-3293


________________________________
 From: Tony IJntema <[email protected]>
To: RBASE-L Mailing List <[email protected]>
Sent: Thursday, May 2, 2013 2:20 AM
Subject: [RBASE-L] - European IBAN (International Bank Account Number) check 
digit calculation


Hi,

In 2014 we will have to use a new bank account number in Europe.

It looks like this: NL91ABNA0417164300

91 is a check digit

This check digit is a result of a mod 97 operation.

The calculation that needs to be performed is:

(mod(101123100417164300232100,97))

(The length of the figure is 24 characters)

The result = 7

The check digit then becomes 98 - 7 = 91

My question is: This figure is too big for a modular operation and bignums
are not allowed in the mod function. Does anybody know a workaround?


N.B.

To rules to create the long figure are:

Change the IBAN to: ABNA0417164300NL00 (Put NL (=countrycode) after the
figure and add two zeroes to it.
Replace all letters by it's position in the Alphabet and add 9 to this
number ( A = 10, B = 11, and so on)

Tony 


Reply via email to