<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: counting matches - need help in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/counting-matches-need-help/m-p/28256#M6562</link>
    <description>No problem for that. Just change the WHERE part of the query to create (just during the execution of the query) a unique variable that is the concatenation of both dob and name... Just make sure the DOB variable have the same length in both tables, to avoid problems with trailing blanks (otherwise apply TRIM() function to the DOB variable in the query).&lt;BR /&gt;
[pre]&lt;BR /&gt;
PROC SQL ;&lt;BR /&gt;
   SELECT COUNT(*) AS howMany&lt;BR /&gt;
   FROM a   &lt;BR /&gt;
   WHERE a.dob!!"/"!!a.name IN (SELECT b.dob!!"/"!!b.name FROM b)&lt;BR /&gt;
/* or TRIM(a.dob)!!"/"!!a.name etc. */&lt;BR /&gt;
   ;&lt;BR /&gt;
QUIT ;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Olivier</description>
    <pubDate>Tue, 01 Jul 2008 08:59:23 GMT</pubDate>
    <dc:creator>Olivier</dc:creator>
    <dc:date>2008-07-01T08:59:23Z</dc:date>
    <item>
      <title>counting matches - need help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/counting-matches-need-help/m-p/28253#M6559</link>
      <description>Pls Help!&lt;BR /&gt;
&lt;BR /&gt;
I have 2 datasets: Dataset A has a list of names and dobs from a membership registry. Dataset B has a list of names and dobs from a testing registry (lab results). We want to know how many (not who) of those listed in dataset A are found in Dataset B. (Hopefully no output file that links due to confidential nature of linking the names to the test file). Is there a way to just get counts of how many from A were found in B?&lt;BR /&gt;
&lt;BR /&gt;
cheers,&lt;BR /&gt;
&lt;BR /&gt;
Maggie</description>
      <pubDate>Sat, 28 Jun 2008 14:58:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/counting-matches-need-help/m-p/28253#M6559</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-06-28T14:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: counting matches - need help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/counting-matches-need-help/m-p/28254#M6560</link>
      <description>Hi Maggie.&lt;BR /&gt;
Once again, SQL is your friend for that kind of problem (ID is a variable that is found in both A and B datasets, but the name can vary from a dataset to another, just change in the syntax below) :&lt;BR /&gt;
[pre]&lt;BR /&gt;
PROC SQL ;&lt;BR /&gt;
   SELECT COUNT(*) AS howMany&lt;BR /&gt;
   FROM a&lt;BR /&gt;
   WHERE a.id IN (SELECT b.id FROM b)&lt;BR /&gt;
   ;&lt;BR /&gt;
QUIT ;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Regards.&lt;BR /&gt;
Olivier</description>
      <pubDate>Sat, 28 Jun 2008 16:49:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/counting-matches-need-help/m-p/28254#M6560</guid>
      <dc:creator>Olivier</dc:creator>
      <dc:date>2008-06-28T16:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: counting matches - need help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/counting-matches-need-help/m-p/28255#M6561</link>
      <description>Thank so much Olivier, &lt;BR /&gt;
I will give this a go. Just another question if you don't mind. I wish we just had a simple study ID but since it will be based on a perfect match of both name and dob (will be strictly formated), do you think there could be any snags when it is rewritten to reflect that? &lt;BR /&gt;
&lt;BR /&gt;
Maggie

Message was edited by: maggie</description>
      <pubDate>Sat, 28 Jun 2008 20:16:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/counting-matches-need-help/m-p/28255#M6561</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-06-28T20:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: counting matches - need help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/counting-matches-need-help/m-p/28256#M6562</link>
      <description>No problem for that. Just change the WHERE part of the query to create (just during the execution of the query) a unique variable that is the concatenation of both dob and name... Just make sure the DOB variable have the same length in both tables, to avoid problems with trailing blanks (otherwise apply TRIM() function to the DOB variable in the query).&lt;BR /&gt;
[pre]&lt;BR /&gt;
PROC SQL ;&lt;BR /&gt;
   SELECT COUNT(*) AS howMany&lt;BR /&gt;
   FROM a   &lt;BR /&gt;
   WHERE a.dob!!"/"!!a.name IN (SELECT b.dob!!"/"!!b.name FROM b)&lt;BR /&gt;
/* or TRIM(a.dob)!!"/"!!a.name etc. */&lt;BR /&gt;
   ;&lt;BR /&gt;
QUIT ;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Olivier</description>
      <pubDate>Tue, 01 Jul 2008 08:59:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/counting-matches-need-help/m-p/28256#M6562</guid>
      <dc:creator>Olivier</dc:creator>
      <dc:date>2008-07-01T08:59:23Z</dc:date>
    </item>
  </channel>
</rss>

