| The DQMATCH Procedure |
The following example creates more than one simple match code with a single PROC DQMATCH step. Unlike the first example, which created a composite match code by specifying MATCHCODE= on the PROC DQMATCH statement, this example creates simple match codes by specifying MATCHCODE= on each CRITERIA statement. In addition, unlike the first example, which creates a cluster number, you cannot create a cluster number when generating multiple simple match codes. To compare the two examples, see Generate Composite Match Codes.
The default sensitivity level of 85 is used in both CRITERIA statements. The locale ENUSA is assumed to have been loaded into memory previously with the %DQLOAD AUTOCALL macro.
/* Create the input data set. */ data cust_db; length customer $ 22; length address $ 31; input customer $char22. address $char31.; datalines; Bob Beckett 392 S. Main St. PO Box 2270 Robert E. Beckett 392 S. Main St. PO Box 2270 Rob Beckett 392 S. Main St. PO Box 2270 Paul Becker 392 N. Main St. PO Box 7720 Bobby Becket 392 Main St. Mr. Robert J. Beckeit P. O. Box 2270 392 S. Main St. Mr. Robert E Beckett 392 South Main Street #2270 Mr. Raul Becker 392 North Main St. ; run; /* Run the DQMATCH procedure. */ proc dqmatch data=cust_db out=out_db5 locale='ENUSA'; criteria matchdef='Name' var=customer matchcode=mc_name; criteria matchdef='Address' var=address matchcode=mc_addr; run; /* Print the results. */ proc print data=out_db5; run;
The output data set, OUT_DB5, includes the new variables MC_NAME and MC_ADDR. Compare this to the result of example 1, where the same match code values were combined to form a composite match code in the MATCH_CD variable.
Your decision to use simple or composite match codes depends on the type of comparison that you need. For example, if you wanted to compare names and addresses separately, then you would probably want to generate separate match codes as shown in this example. If you always want to do comparisons based on the combined Name and Address, then you might want to generate a composite match code as shown in example 1.
This example is available in the SAS Sample Library under the name DQMCDFL2.
Copyright © 2007 by SAS Institute Inc., Cary, NC, USA. All rights reserved.