This example determines the validity of a 19-digit credit card number as is becoming commonplace in EMEA. A 19-digit credit card number is reformatted to a 16-digit segment and a 3-digit segment. The credit card number is valid if the sum of the modulus 10 results for segment 1 and segment 2 are equal to 0 or 10 as described in the following example.
1. collect 16 digits after announcement 2300 for A
2. collect 3 digits after announcement 2301 for B
(Create two separate digit strings for LUHN validations)
3. set C = A CATL 0 (insert a dummy 0 at the beginning of the number)
4. set D = A SEL 1 (grab the sixteenth digit)
5. set D = D CATR B (concatenate the 16th digit with the last 3 digits)
6. set C = C MOD10 16
7. set D = D MOD10 4
8. set C = A MOD10 16
9. set D = B MOD10 4
10.set E = C ADD D
11.goto vector 20 at step 1 if E = +0 [pass 0 test]
12.fail treatment for an invalid credit card
A valid number results in a 0 or a multiple of 10.