<?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: WHERE Statement Efficiency in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196637#M305298</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Note that one way to simplify your code would be to restructure (normalize) your data.&amp;nbsp; Having a wide dataset with variables like DIGNOSIS1-DIAGNOSIS4 often makes code more difficult to write and maintain than if data are normalized into a narrow format with just a single DIAGNOSIS variable and repeating rows.&amp;nbsp; Key point being that if you ever get a patient with a fifth diagnosis, you will not need to update all your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I spent a lot of time in my early years manipulating data with lots of arrays,&amp;nbsp; until I was lucky to have a boss point out that simplified data structures lead to simplified code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Aug 2015 16:05:05 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2015-08-11T16:05:05Z</dc:date>
    <item>
      <title>WHERE Statement Efficiency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196632#M305293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a more efficient way to write the following code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;create table ABC as&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;select t1.age,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t1.gender,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t1.diagnosis1,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t1.diagnosis2,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t1.diagnosis3,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t1.diagnosis4&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; work.testfile t1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; t1.diagnosis1 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4330"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43301"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43310"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43311"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43320"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43321"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43330"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43331"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43380"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43381"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43390"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43391"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4340"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43401"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43410"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43411"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43490"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43491"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4350"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4351"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4352"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4353"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4358"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4359"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;or&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; t1.diagnosis2 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4330"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43301"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43310"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43311"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43320"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43321"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43330"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43331"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43380"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43381"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43390"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43391"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4340"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43401"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43410"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43411"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43490"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43491"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4350"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4351"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4352"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4353"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4358"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4359"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;or&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; t1.diagnosis3 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4330"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43301"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43310"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43311"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43320"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43321"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43330"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43331"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43380"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43381"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43390"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43391"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4340"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43401"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43410"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43411"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43490"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43491"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4350"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4351"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4352"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4353"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4358"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4359"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;or&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; t1.diagnosis4 &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;in&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4330"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43301"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43310"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43311"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43320"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43321"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43330"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43331"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43380"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43381"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43390"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43391"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4340"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43401"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43410"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43411"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43490"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"43491"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4350"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4351"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4352"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4353"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4358"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"4359"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2015 14:34:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196632#M305293</guid>
      <dc:creator>kparker</dc:creator>
      <dc:date>2015-08-11T14:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE Statement Efficiency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196633#M305294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps put the codes in a format and then evaluate?&lt;/P&gt;&lt;P&gt;Or a data step with an array?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;keep age diagnosis1-diagnosis4;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;array diag(4) diagnosis1-diagnosis4;&lt;/P&gt;&lt;P&gt;keep=0;&lt;/P&gt;&lt;P&gt;do i=1 to dim(diag);&lt;/P&gt;&lt;P&gt;if diag(i) in &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"4330"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"43301"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"43310"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"43311"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"43320"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"43321"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"43330"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"43331"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"43380"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"43381"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"43390"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"43391"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"4340"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"43401"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"43410"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"43411"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"43490"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"43491"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"4350"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"4351"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"4352"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"4353"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"4358"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: #800080;"&gt;"4359"&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;) then keep=1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;if keep=1;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 12pt; font-family: 'Courier New';"&gt;run;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2015 14:44:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196633#M305294</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-08-11T14:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE Statement Efficiency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196634#M305295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Without changing the syntax you should think of using a macro variable anytime you type something over again like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let list = ("4330","43301","43310","43311","43320","43321","43330","43331","43380","43381","43390","43391","4340","43401",&lt;/P&gt;&lt;P&gt;"43410","43411","43490","43491","4350","4351","4352","4353","4358","4359");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table ABC as&lt;/P&gt;&lt;P&gt;select t1.age,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t1.gender,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t1.diagnosis1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t1.diagnosis2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t1.diagnosis3,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t1.diagnosis4&lt;/P&gt;&lt;P&gt;from work.testfile t1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where t1.diagnosis1 in &amp;amp;list&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or t1.diagnosis2 in &amp;amp;list&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or t1.diagnosis3 in &amp;amp;list&lt;/P&gt;&lt;P&gt;or t1.diagnosis_oth4_cd in &amp;amp;list;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would probably use a proc tranpose but I'm sure there are a lot of ways. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2015 14:47:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196634#M305295</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-08-11T14:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE Statement Efficiency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196635#M305296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Define your need for efficiency: code brevity, program run time, memory/disk utilization, something else.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2015 15:08:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196635#M305296</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-08-11T15:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE Statement Efficiency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196636#M305297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Code brevity or a better way of writing the code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2015 15:27:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196636#M305297</guid>
      <dc:creator>kparker</dc:creator>
      <dc:date>2015-08-11T15:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE Statement Efficiency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196637#M305298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Note that one way to simplify your code would be to restructure (normalize) your data.&amp;nbsp; Having a wide dataset with variables like DIGNOSIS1-DIAGNOSIS4 often makes code more difficult to write and maintain than if data are normalized into a narrow format with just a single DIAGNOSIS variable and repeating rows.&amp;nbsp; Key point being that if you ever get a patient with a fifth diagnosis, you will not need to update all your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I spent a lot of time in my early years manipulating data with lots of arrays,&amp;nbsp; until I was lucky to have a boss point out that simplified data structures lead to simplified code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2015 16:05:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196637#M305298</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2015-08-11T16:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE Statement Efficiency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196638#M305299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, the data is as normalized as we can get it.&amp;nbsp; The nature of our database (all payers claims data) will not allow the structure you are suggesting.&amp;nbsp; I have a total of 12 diagnosis fields and 7 procedure code fields with a total of 219 columns.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2015 16:11:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196638#M305299</guid>
      <dc:creator>kparker</dc:creator>
      <dc:date>2015-08-11T16:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE Statement Efficiency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196639#M305300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to add after seeing your post, I am not suggesting chaning your database, just your working copy which you are processing.&amp;nbsp; Having 219 columns will make your code more complicated, unless your using arrays - (i.e. SQL will just be long winded) - per Reeza's example.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would agree with Quentin here.&amp;nbsp; Normalize your data to get:&lt;/P&gt;&lt;P&gt;AGE GENDER&amp;nbsp;&amp;nbsp;&amp;nbsp; DIAG_NO&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DIAG&lt;/P&gt;&lt;P&gt;xx&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xxxx&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4330&lt;/P&gt;&lt;P&gt;xx&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xxxx&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2345&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then have your list of data to find in another dataset - I personally don't like the use of macro variables to hold lots of data:&lt;/P&gt;&lt;P&gt;DIAG&lt;/P&gt;&lt;P&gt;4330&lt;/P&gt;&lt;P&gt;43301&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then its a simple lookup:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table WANT as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AGE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,GENDER&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,DIAG_NO,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,DIAG&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DIAG in (select distinct DIAG from LOOKUP);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2015 16:13:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196639#M305300</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-08-11T16:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE Statement Efficiency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196640#M305301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Even if the database that stores the data is not normalized (unfortunately), as a SAS programmer it's often helpful to normalize data for yourself before you do any processing.&amp;nbsp; Often for a project, or for a data source I will use across projects, I have a %reformatdata() macro which reads some source data in a format I don't like and reshapes it into a format I do like.&amp;nbsp; If the data are big, can do this as a nightly ETL job, or do it for just the subset I'm interested it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Given&amp;nbsp; a table with variables: patient age gender claimdate diagnosis1-diagnosis12 procedure1-procedure7, I might reshape it into three tables.&amp;nbsp; Patient table with patient age gender.&amp;nbsp; Diagnosis table with Patient, ClaimDate, Diagnosis.&amp;nbsp; Procedure Table with Patient, ClaimDate, Procedure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once I have that done, answering most of the anticipated questions is easier.&amp;nbsp; Which patients have one of these diagnosis codes?&amp;nbsp; Which patients have both diagnosis A and diagnosis B?&amp;nbsp; Which patients had diagnosis X within one month following treatment with procedure Y.&amp;nbsp; What is the average number of diagnoses per patient?&amp;nbsp; etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2015 16:48:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196640#M305301</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2015-08-11T16:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE Statement Efficiency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196641#M305302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reeza, a small improvement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do i=1 to dim(diag) until (keep=1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That way, if DIAGNOSIS1 is a match, there's no need to check the other 3 variables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2015 22:45:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196641#M305302</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-08-11T22:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE Statement Efficiency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196642#M305303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;g&amp;gt; One can always find something to optimize. I LOVE this job. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 07:16:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196642#M305303</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-08-12T07:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE Statement Efficiency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196643#M305304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with Quentin and others. A normalised structure is better in most ways. Easier to maintain and query.&lt;/P&gt;&lt;P&gt;If that's not an option consider storing the data in SPDE in which the where-planner can optimise OR conditions&amp;nbsp; (given that the columns are indexed).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Aug 2015 08:18:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-Statement-Efficiency/m-p/196643#M305304</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-08-12T08:18:38Z</dc:date>
    </item>
  </channel>
</rss>

