4/23/2021 0 Comments How To Find The Check Digit
This tool uses JavaScript and much of it will not work correctly without it enabled.How do i go about to create expressions for find the check digit using Mod-10 Thanks.Credit card no validation or for other no validation like IMEI, NPIN etc Anyway, I assume it as CC but this should work for others as well.
In every CC, the last digit is the check digit and you can use mod-10 algorithm to perform validation of same. Find The Check Digit How To Implement ThisIn case, you are not familiar with algorithm read below: Coming to how to implement this in Informatica, theres no special function available, youll have to build the logic with expression Tx as below: 1. This gives position of check digit or no of digits in CC. Segregate the CC into digits. Create a total of 19 ports (max no of digits a credit card can contain) to hold each digit. If the port also happen to contain the check digit (check from step 1) make it zero (0). Also, for those CC where the length is less than 19, you can make the unutilized ports value as 0 (after applying substr use isnull function for each port). Next, convert the ports into integer using tointeger function. If the no of digits in CC is even, double the odd position port. ![]() Find The Check Digit Series Of ExpHowever, its possible to perform it inside a single Exp Tx instead of building a series of Exp Tx. According to the rules that I see, to calculate the check digit value, I need to start from the right most digit, moving left, and double the value of every second digit. Like below, right Account number 7 9 9 2 7 3 9 8 7 1 x Double every other 7 18 9 4 7 6 9 16 7 2 x Sum of digits 7 9 9 4 7 6 9 7 7 2 6 7 Check digit will be 10 - 7 3. In your example, you have 11 digits and you end up doubling 10th, 8th, 6th and so on. ![]() Hope you got this. Sum up all digits: if there are any numbers 10, you need to sum up individual digits at tenth and unit place, eg: for 18, youll sum up 18. To implement this, we can use trunc and mod functions, Trunc(digit10,0) gets the digit at tenth place. Mod(digit,10)gives digit at unit place i.e 8 for mod(18,10). Finally, repeating this for each port and summing up would get you 67. Finally, get the last digit of the total digit sum (7 in your example)and count till 10 to get the check digit. Another way to implement same would be multiply the result above with 9 and getting the mod 10 for same. So, how can I find out if the CC is odd or even I can see the LENGTH command which gives only the length of the CC. Do I need to create a seperate variable for ODD or EVEN CC And also, I guess i need to LDAP the CC if its less than 20 digits right I understand the logic but not sure how to put it together. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |