IBAN
- minty_dra
- Topic Author
- Offline
- Junior Member
- Posts: 24
- Thank you received: 0
Please Log in or Create an account to join the conversation.
- durai611
- Offline
- Elite Member
- Posts: 300
- Thank you received: 51
Regards,
Durairaj. N
Please Log in or Create an account to join the conversation.
- jpb
- Offline
- Moderator
- TAFj-R20 - 'unix'
- Posts: 2854
- Thank you received: 649
CALL FT.CHECK.IBAN(R.NEW(BEN.ACCT.NO)[6,99],Y.CHECK)
IF Y.CHECK <> 1 THEN
IF PGM.VERSION[1,10] NE ",SCHZ.ORD." THEN
TEXT = "Please check! IBAN is not correct"
CALL REM
TEXT = ""
END
END
*-----------------------------------------------------------------------------
* <Rating>-85</Rating>
*-----------------------------------------------------------------------------
SUBROUTINE FT.CHECK.IBAN(Y.IBAN,Y.CHECK)
*****************************************************************************************
$INSERT I_COMMON
$INSERT I_EQUATE
MAIN:
*====
Y.LEN = LEN(Y.IBAN)
Y.CTRY.CODE = Y.IBAN[1,2]
Y.CHECK.DIG.THERE = Y.IBAN[3,2]
Y.CHECK.DIGIT = Y.IBAN[Y.LEN,1]
Y.BBAN = Y.IBAN[5,Y.LEN-4]
GOSUB INITIALISE
GOSUB PROCESS.CHECK
RETURN
INITIALISE:
*==========
ALFA = '0A':FM:'1B':FM:'2C':FM:'3D':FM:'4E':FM:'5F':FM:'6G':FM:'7H':FM:'8I':FM:'9J':FM:'K':FM:'L':FM:'M':FM:'N':FM:'O':FM:'P':FM:'Q':FM:'R':FM:'S':FM:'T':FM:'U':FM:'V':FM:'W':FM:'X':FM:'Y':FM:'Z'
ALFA.A = 'A':FM:'B':FM:'C':FM:'D':FM:'E':FM:'F':FM:'G':FM:'H':FM:'I':FM:'J':FM:'K':FM:'L':FM:'M':FM:'N':FM:'O':FM:'P':FM:'Q':FM:'R':FM:'S':FM:'T':FM:'U':FM:'V':FM:'W':FM:'X':FM:'Y':FM:'Z'
ALFA.P = '0':FM:'1':FM:'2':FM:'3':FM:'4':FM:'5':FM:'6':FM:'7':FM:'8':FM:'9':FM:'10':FM:'11':FM:'12':FM:'13':FM:'14':FM:'15':FM:'16':FM:'17':FM:'18':FM:'19':FM:'20':FM:'21':FM:'22':FM:'23':FM:'24':FM:'25'
ALFA.I = '1':FM:'0':FM:'5':FM:'7':FM:'9':FM:'13':FM:'15':FM:'17':FM:'19':FM:'21':FM:'2':FM:'4':FM:'18':FM:'20':FM:'11':FM:'3':FM:'6':FM:'8':FM:'12':FM:'14':FM:'16':FM:'10':FM:'22':FM:'25':FM:'24':FM:'23'
ALFA.C = '10':FM:'11':FM:'12':FM:'13':FM:'14':FM:'15':FM:'16':FM:'17':FM:'18':FM:'19':FM:'20':FM:'21':FM:'22':FM:'23':FM:'24':FM:'25':FM:'26':FM:'27':FM:'28':FM:'29':FM:'30':FM:'31':FM:'32':FM:'33':FM:'34':FM:'35'
NEW.ACCT = ''
TOTAL.WEIGHT = 0
RETURN
*
PROCESS.CHECK:
*=============
* CHANGE IBAN-FORMAT FROM XX10002300A1023502601
* TO 002300A1023502601XX10
Y.NUMBER = Y.BBAN:Y.CTRY.CODE:Y.CHECK.DIG.THERE
LENY.ACCT = LEN(Y.NUMBER)
Y.CDIG = Y.NUMBER
Y.LEN.NB = LEN(Y.CDIG)
*Check CHECK DIGIT code
NEW.STR = ""
FOR I = 1 TO Y.LEN.NB
Y.CHAR = Y.CDIG[I,1]
FINDSTR Y.CHAR IN ALFA.A SETTING ALPHA.POS THEN
NEW.VAL = ALFA.C<ALPHA.POS>
NEW.STR := NEW.VAL
END ELSE
NEW.STR := Y.CHAR
END
NEXT I
* split into several division
Y.CDIG = NEW.STR
Y.LEN.STR = LEN(NEW.STR)
Y.PART1 = Y.CDIG[1,9]
Y.PART2 = Y.CDIG[10,7]
Y.PART3 = Y.CDIG[17,7]
Y.PART4 = Y.CDIG[24, Y.LEN.STR-23]
Y.REST1 = MOD(Y.PART1,97)
Y.PART2 = Y.REST1:Y.PART2
Y.REST2 = MOD(Y.PART2,97)
Y.PART3 = Y.REST2:Y.PART3
Y.REST3 = MOD(Y.PART3,97)
Y.PART4 = Y.REST3:Y.PART4
Y.REST = MOD(Y.PART4,97)
* if the rest is equal to 1 means the IBAN has a correct Control Number
Y.CHECK = Y.REST
RETURN
*
*=====
END
Please Log in or Create an account to join the conversation.
- minty_dra
- Topic Author
- Offline
- Junior Member
- Posts: 24
- Thank you received: 0
Please Log in or Create an account to join the conversation.
- jpb
- Offline
- Moderator
- TAFj-R20 - 'unix'
- Posts: 2854
- Thank you received: 649
although there are some unneeded lines in the routine (it was in a process of try and error ;-) the main logic is developed from the description in en.wikipedia.org/wiki/International_Bank...ng_IBAN_check_digits.
The logic for mod-97 calculation is flexible, you'll find explanations on the web.
Unneeded:
Y.CHECK.DIGIT = Y.IBAN[Y.LEN,1]
ALFA = '0A...
ALFA.P ...
ALFA.I ...
LENY.ACCT = LEN(Y.NUMBER)
Improvement:
As I'm not sure there are only capital letters used in IBAN, the line
FINDSTR Y.CHAR IN ALFA.A SETTING ALPHA.POS THEN
could be changed to
FINDSTR UPCASE(Y.CHAR) IN ALFA.A SETTING ALPHA.POS THEN
to be on the save side.
Please Log in or Create an account to join the conversation.
- stahir65
- Offline
- New Member
- Posts: 14
- Thank you received: 0
I have the same issue to assigned IBAN account id as an alternate account id. first I have created a new alternate account id in ALT.ACCT.PARAMETER table as 'IBAN' following fields added
I am from pakistan
Step# 1
File Name: ALT.ACCT.PARAMETER
GB description : INTL BANK ACCOUNT NUMBER
Description: IBAN
Max Length: 16
Min Length:
Acct No Type: A
Display Mask: #####-###############
Step#2
File Name: ACCOUNT.PARAMETER
23.1 ALTERNATE.ID: LEGACY (Already Exist for PIBAS A/cs)
23.2 ALTERNATE.ID: IBAN (New One for IBAN)
For Pakistan we will use 24 digit IBAN number i.e PK47XBBB00000000012345678
let suppose our normal account number is 12345678, for IBAN it will be PK47XBBB00000000012345678
PK = Country code
47 = Bank Code
XBBB= Bank Name
00000000012345678 = Account Number (16 digits)
when I will open a new account 12345678 from ACCOUNT application and try to assign new IBAN number in ALT.ACCT.ID field where defined IBAN for ALT.ACCT.ID system did not allowed to input the IBAN Account number (PK47XBBB00000000012345678) Error To Many Character if I input 16 digits it will accept but do not save it
please help me where I am wrong and what i have to do it
Thanks
Syed Tahir
Please Log in or Create an account to join the conversation.
- jpb
- Offline
- Moderator
- TAFj-R20 - 'unix'
- Posts: 2854
- Thank you received: 649
When you see two input fields for ALT.ACCT.ID, one with TYPE LEGACY and one with IBAN it should be OK to use them.
The IBAN should be present in ACCOUNT and in ALTERNATE.ACCOUNT.
Please Log in or Create an account to join the conversation.
- stahir65
- Offline
- New Member
- Posts: 14
- Thank you received: 0
I am input new account number which is not contain old legacy number but new IBAN number, I am trying both way to input only IBAN number and save system give me error Too Many Character, EITHER I will input both ALT.ACCT.ID as IBAN
Thanks
Syed Tahir
Please Log in or Create an account to join the conversation.
- jpb
- Offline
- Moderator
- TAFj-R20 - 'unix'
- Posts: 2854
- Thank you received: 649
Please Log in or Create an account to join the conversation.
- stahir65
- Offline
- New Member
- Posts: 14
- Thank you received: 0
Please Log in or Create an account to join the conversation.
- jpb
- Offline
- Moderator
- TAFj-R20 - 'unix'
- Posts: 2854
- Thank you received: 649
Please Log in or Create an account to join the conversation.
- stahir65
- Offline
- New Member
- Posts: 14
- Thank you received: 0
EB.ALTERNATE.KEY
ALT.KEY.FIELD: ALT.ACCT.ID
CONTACT.TYPE: SYSTEM
ACCESS.METHOD: READ
UNIQUE: SYSTEM
THE GIVEN BELOW DETAIL OF MY EB.ALTERNATE.KEY
Please Log in or Create an account to join the conversation.
- durai611
- Offline
- Elite Member
- Posts: 300
- Thank you received: 51
Normally system allows to give only 16 digits of account number. To allow more than that you have to create a record in EB.OBJECT as show below
OBJECT.ID......... ACCOUNT
1. 1 GB DESCRIPTION. Standard length for Account Number
2 MAX.LENGTH........ 35
After creating this record, follow the steps as suggested by jpb.
Please Log in or Create an account to join the conversation.
- jpb
- Offline
- Moderator
- TAFj-R20 - 'unix'
- Posts: 2854
- Thank you received: 649
I think it has to be deleted if you use ALTERNATE.ACCOUNT . . .
Please Log in or Create an account to join the conversation.
- stahir65
- Offline
- New Member
- Posts: 14
- Thank you received: 0
Please Log in or Create an account to join the conversation.
- jpb
- Offline
- Moderator
- TAFj-R20 - 'unix'
- Posts: 2854
- Thank you received: 649
Please Log in or Create an account to join the conversation.
- durai611
- Offline
- Elite Member
- Posts: 300
- Thank you received: 51
You can define a multivalue field as alternate key, but it should not hold multiple values.
In your case, ALT.ACCT.ID field already holds value for 23.1 ALTERNATE.ID: LEGACY (Already Exist for PIBAS A/cs) and now you are trying to provide value for 23.2 ALTERNATE.ID: IBAN (New One for IBAN).
Do you really want EB.ALTERNATE.KEY for ACCOUNT application because you have already defined ALT.ACCT.PARAMETER?
I think you might have got confused with EB.ALTERNATE.KEY and ALT.ACCT.PARAMETER.
Please Log in or Create an account to join the conversation.
- stahir65
- Offline
- New Member
- Posts: 14
- Thank you received: 0
ALT.KEY.FIELD: ALT.ACCT.ID
CONTACT.TYPE: SYSTEM
ACCESS.METHOD: READ
UNIQUE: SYSTEM
THE GIVEN BELOW DETAIL OF MY EB.ALTERNATE.KEY
Please Log in or Create an account to join the conversation.
- stahir65
- Offline
- New Member
- Posts: 14
- Thank you received: 0
Please Log in or Create an account to join the conversation.
- jpb
- Offline
- Moderator
- TAFj-R20 - 'unix'
- Posts: 2854
- Thank you received: 649
I suppose this record is quite old, from the installation of Globus (before 1999) ??
Please Log in or Create an account to join the conversation.