Credit Card Number Validation
Credit Card Number Validation Benford's Law Fraud detectionDownloads First digits lawSite Map
Home Page | Population | Sampling | Fraud | Other | Tutorial | Macros
Credit Card Number Validation

Command Overview

The lu command is used to identify credit card numbers which are invalid, for those which use the LUHN-10 number validation method., etc. The command supports four sources of data for testing:

  1. Data file in tab separated value format
  2. WorkSheet
  3. Selected range within a worksheet
  4. Database (e.g. MS-Access, MySQL, etc)
The LUHN-10 method is used by the following organizations in their numbers/credit cards:
  • Mastercard credit cards (16 digits)
  • Visa Credit Cards (16 digits)
  • Diner's Club Credit Cards (14 digits)
  • Air Canada Aeroplan Membership Number (9 digits)
  • Bell Express Vu Account Numbers (16 digits)
  • CAA Membership numbers (16 digits)
  • Canadian Social Insurance Numbers (9 digits)
  • Canadian GST/HST Registration number (9 digits)
  • IEEE Membership Number (8 digits starting with 0)
  • Aliant Account Numbers (8 digits)
  • Province of NB Medicare Numbers (9 digits)

 

 

Syntax

The command is entered on the command line as the command name ("luhn10", or just "lu") followed by one or more command parameters. Each command parameter consists of an argument name, immediately followed by an equal sign ("=") and then immediately followed by a value. The value may be enclosed with quotation marks, and must be enclosed by quotation marks if the value consists of any embedded spaces.

An example of a command parameter to specify that the file name to be processed is test.txt is entered as "file=test.txt" (without the quotations). Each argument on the command line must consist of only valid parameter names. If a required parameter name is missing, then the command line will be colored yellow, an error message will be displayed on the Excel status bar and an audible tone will be sounded.

The following is a listing of all parameter values for the LU command:

Argument name Description Example
Common Parameters (Required for all)
col the name of the column containing the amount to be tested "cc number "
recap the worksheet where the results are to be stored $Results
File Data Source (ds=file)
file the name of the file to be processed \test\invoice.txt
Worksheet Data Source (ds=rng)
sheet the name of the worksheet to be processed LU
ulc upper left hand corner of the range to be processed a2
Worksheet Selected Range (ds=sel)
sheet the name of the worksheet to be processed LU
Database (ds=db)
sql the SQL query to obtain the data to be used as a source "select number, luhn10 from lu "
conn the connection string for the database (varies by type of database) "c:\ms\data\lu.mdb"

 

 

An example

The command to be perform a test of credit card numbers on the file named \test\invoice\tran.txt using the credit card number column named "cc number ", storing the results on the worksheet named "Potential Invalid CC " is as follows:

 

lu ds=file file="c:\ms\data\lu.txt" col=number recap=ccres
lu ds=rng sheet=LU1 col=number ulc=a1 recap=ccres
lu ds=sel sheet=LU1 col=number recap=ccres
lu ds=db conn="c:\ms\data\lu.mdb" sql="select number, luhn10 from lu" recap=ccres fldno=0

 

Output from the processing will include a text listing of invalid credit card numbers

The command bar to process an lu command is as follows:

Output from the command is stored on a worksheet, an example of which is shown below:

 

The data source used consisted of five credit card numbers, one of which is invalid:

 

Main Form

Complete Auditor resources
Links | Privacy Policy | FAQ | Downloads | Trademarks
Web Page last updated on 11-10-2007
© EZ-R Stats, LLC 2005-2007