Testing the Validity of the PAN No - Part 2

1 post / 0 new
Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57
Testing the Validity of the PAN No - Part 2
Hello Group Members,
 
Continuing from Part 1 of the discussion post yesterday to test the validity of the PAN Number we look at testing the first 5 digits of the PAN for occurrence of any number or special character in the first 5 digits. As we mentioned in Part 1 below the first 5 digits of the PAN must necessarily be only character - letter representations. So the occurrence of a number or special character will signify an invalid PAN
 
The test can be accomplished by using Direct Extraction and/or Criteria -
 
The condition will be ~ 
 
@len(@justletters(@left(PAN No,5))) <> 5
 
Let’s decipher the Criteria above.
 
@justletters(@left(PAN No, 5)) will extract only the characters - letters from the first 5 digits of the PAN No (Field Name in your underlying database). The @left nested within the @justletters will capture the first 5 digits of the PAN.
 
Then @len on @justletters(@left(PAN No,5)) will give us the count of the letters extracted above from the left most 5 digits.
 
An ideal required count is 5. Anything other than 5 is an exception to the validity test.
 
Now as an example while a standard PAN should look like ABCPD1234E, we see Teams entering the PAN No as PANNOTAVAIL or perhaps NOTAVAILAB signifying PAN not available. This is done to meet the first requirement of length of PAN being 10. If you look at PANNOTAVAIL or NOTAVAILAB they also meet the second requirement of first 5 digits of the PAN being letters. But these are still invalid as the next 4 digits should be numbers as you can see in ABCPD1234E above. So PANNOTAVAIL or NOTAVAILAB will fail the third validity test of numbers which we will be covering in the discussion post tomorrow under Part 3.
 
Best Regards
 
Group Admin Team