<?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: Filtering Health Data using Drug Identification Numbers (DINs) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693982#M211620</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; Each item uses 48 bytes in a one-numeric-key hash table.&lt;/P&gt;</description>
    <pubDate>Sat, 24 Oct 2020 09:19:43 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2020-10-24T09:19:43Z</dc:date>
    <item>
      <title>Filtering Health Data using Drug Identification Numbers (DINs)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693348#M211381</link>
      <description>&lt;P&gt;Hello, I am trying to filter a health data to identify my study population using specific Drug Identification Numbers (DINs) for asthma inhaler medications. I have a list of DINs I am interested in. I will like SAS to identify individuals and observations that matches one of the DINs. Here are some of the DINs I am interested in: &lt;STRONG&gt;812463; 824216, 851752;851760;851841 etc. &lt;/STRONG&gt;I really need help on this. Any comments would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 23:42:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693348#M211381</guid>
      <dc:creator>Asboaheng</dc:creator>
      <dc:date>2020-10-21T23:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Health Data using Drug Identification Numbers (DINs)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693349#M211382</link>
      <description>&lt;P&gt;Simple with SQL, if dataset size is not that large:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
  select *
  from have
  where din in (select din from reference)
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Oct 2020 23:56:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693349#M211382</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-21T23:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Health Data using Drug Identification Numbers (DINs)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693350#M211383</link>
      <description>&lt;P&gt;I think this syntax is better not shown; it's disastrous when the volumes grow.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An inner join is always valid:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;proc sql;
  create table WANT as
  select HAVE.*
  from HAVE, DINLIST
  where HAVE.DIN = DINLIST.DIN;
quit;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 00:15:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693350#M211383</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-10-22T00:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Health Data using Drug Identification Numbers (DINs)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693351#M211384</link>
      <description>&lt;P&gt;Or if there are duplicates:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;proc sql;
  create table WANT as
  select HAVE.*
  from HAVE, (select unique DIN from DINLIST) DINLIST
  where HAVE.DIN = DINLIST.DIN;
quit;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 00:16:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693351#M211384</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-10-22T00:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Health Data using Drug Identification Numbers (DINs)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693354#M211386</link>
      <description>&lt;P&gt;Another option is to create a custom format that has a formatted value of "Want", or similar, for the values of interest and "Not wanted" for other values.&lt;/P&gt;
&lt;P&gt;Then you can either select records with a where statement or use the formatted value directly, depending on need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 00:53:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693354#M211386</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-10-22T00:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Health Data using Drug Identification Numbers (DINs)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693360#M211389</link>
      <description>&lt;P&gt;1. Use a WHERE statement, applied in either SQL or Data step&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where DIN in (812463, 824216.....);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;2. Create a lookup data set&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dins_asthma;
input DIN;
cards;
812463
824216
851752
;;;;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then any of the other suggestions will work for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/322591"&gt;@Asboaheng&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello, I am trying to filter a health data to identify my study population using specific Drug Identification Numbers (DINs) for asthma inhaler medications. I have a list of DINs I am interested in. I will like SAS to identify individuals and observations that matches one of the DINs. Here are some of the DINs I am interested in: &lt;STRONG&gt;812463; 824216, 851752;851760;851841 etc. &lt;/STRONG&gt;I really need help on this. Any comments would be greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 01:34:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693360#M211389</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-10-22T01:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Health Data using Drug Identification Numbers (DINs)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693386#M211402</link>
      <description>&lt;P&gt;Maybe something solving your problem has already been suggested, if not you should post an excerpt of the data you have or the result of proc contents, so that we actually know how what "health data" is in your case.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 04:57:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693386#M211402</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-10-22T04:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Health Data using Drug Identification Numbers (DINs)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693491#M211461</link>
      <description>&lt;P&gt;The data size is very large but i will try this whether it will work. Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 13:01:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693491#M211461</guid>
      <dc:creator>Asboaheng</dc:creator>
      <dc:date>2020-10-22T13:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Health Data using Drug Identification Numbers (DINs)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693494#M211464</link>
      <description>&lt;P&gt;Thank you. Will try this option too. Just that i have a tall list of DIN lists (about 450 DINS).&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 13:03:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693494#M211464</guid>
      <dc:creator>Asboaheng</dc:creator>
      <dc:date>2020-10-22T13:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Health Data using Drug Identification Numbers (DINs)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693498#M211466</link>
      <description>&lt;P&gt;Define "large".&lt;/P&gt;
&lt;P&gt;The (probably) most efficient method would be a hash object in a data step, as long as you can fit the reference numbers into memory (likely, because you'll basically need 8 bytes * number of items, not much in the times of gigabyte RAM).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
if _n_ = 1
then do;
  declare hash r (dataset:"reference");
  r.definekey("din");
  r.definedone();
end;
if r.check() = 0;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The only sorting is done in memory on the lookup table.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 13:07:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693498#M211466</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-22T13:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Health Data using Drug Identification Numbers (DINs)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693982#M211620</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; Each item uses 48 bytes in a one-numeric-key hash table.&lt;/P&gt;</description>
      <pubDate>Sat, 24 Oct 2020 09:19:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693982#M211620</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-10-24T09:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Health Data using Drug Identification Numbers (DINs)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693986#M211622</link>
      <description>&lt;P&gt;So we have 40 bytes overhead per item? That would be an interesting fact for future calculations of RAM requirements.&lt;/P&gt;</description>
      <pubDate>Sat, 24 Oct 2020 10:53:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/693986#M211622</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-24T10:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Health Data using Drug Identification Numbers (DINs)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/694066#M211661</link>
      <description>&lt;P&gt;48 bytes is the minimum size (on 64-bit systems), then 16-byte increments.&lt;/P&gt;
&lt;P&gt;See the &lt;A href="https://communities.sas.com/kntur85557/attachments/kntur85557/programming/174381/1/HashSize.sas" target="_self"&gt;macro&lt;/A&gt; I posted &lt;A href="https://communities.sas.com/t5/SAS-Programming/Removing-duplicates-by-removing-reappeared-chunk-of-records/m-p/601848#M174144" target="_self"&gt;here&lt;/A&gt;, it explains the allocation logic, and does the calculations for you.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Oct 2020 02:20:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/694066#M211661</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-10-25T02:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Health Data using Drug Identification Numbers (DINs)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/694457#M211786</link>
      <description>&lt;P&gt;So the minimum overhead for the internal search table seems to be 32 bytes per item. The macro will come in handy, thanks for posting.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 08:59:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/694457#M211786</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-27T08:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering Health Data using Drug Identification Numbers (DINs)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/694466#M211791</link>
      <description>&lt;P&gt;For completenes.. If the range of DINs is somewhat sparse, this should be quite fast as well...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data din;
input din;
datalines;
812463
824216
851752
851760
851841
;

data have;
input din v;
datalines;
812463 1
123456 2
824216 3
234567 4
851752 5
345678 6
851760 7
456789 8
851841 9
;

data want;
   array d {0 : 999999} _temporary_;
   do until (z1);
      set din end = z1;
      d[din] = 1;
   end;
   do until (z2);
      set have end = z2;
      if d[din] then output;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Oct 2020 09:45:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Filtering-Health-Data-using-Drug-Identification-Numbers-DINs/m-p/694466#M211791</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-10-27T09:45:02Z</dc:date>
    </item>
  </channel>
</rss>

