DQMATCH Procedure

Example 4: Creating Match Codes for Parsed Values

The following example creates match codes for parsed character data. The program loads locales, determines a parse definition, creates character elements, creates parsed character values, and creates match codes for the parse character elements
This example is available in the SAS Sample Library under the name DQMCPARS.
/* load locales */

/* Determine the parse definition associated with your */
/* match definition.                                   */
data _null_;
   call symput('parsedefn', parsedefn);
   put 'The parse definition for the NAME match definition is: ' parsedefn;
   put 'The ' parsedefn 'parse definition tokens are:' / @5 tokens;

/* Create variables containing name elements. */
data parsed;
   length first last $ 20;
   first='Scott'; last='James';  output;
   first='James'; last='Scott';  output;
   first='Ernie'; last='Hunt';   output;
   first='Brady'; last='Baker';  output;
   first='Ben';   last='Riedel'; output;
   first='Sara';  last='Fowler'; output;
   first='Homer'; last='Webb';   output;
   first='Poe';   last='Smith';  output;

/* Create parsed character values. */
data parsedview;
   set parsed;
   length delimstr $ 100;

   * Insert one token at a time;
   delimstr=dqParseTokenPut(delimstr, first, 'Given Name',  'Name');
   delimstr=dqParseTokenPut(delimstr, last,  'Family Name', 'Name');

/* Generate match codes using the parsed character values. */
proc dqmatch data=parsedview
   criteria matchdef='Name' delimstr=delimstr sensitivity=85;

/* Print the match codes. */
proc print data=mcodes;
   title 'Look at the match codes from PROC DQMATCH';
PROC Print Output
PROC Print Output for Parsed Values Example