<?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: Check for special values in numbered range lists in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Check-for-special-values-in-numbered-range-lists/m-p/164198#M31754</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your source data is in SAS tables, and if you want to subset your data with this condition, use WHERE instead,&lt;/P&gt;&lt;P&gt;Otherwise, I can't see any real alternative. Syntactically you could use an array instead, but it's very unlikely that it could be more efficient than built-in functions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Apr 2014 09:04:55 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2014-04-02T09:04:55Z</dc:date>
    <item>
      <title>Check for special values in numbered range lists</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-for-special-values-in-numbered-range-lists/m-p/164196#M31752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've used numbered range lists to input variables and to check them for missing values, which worked quite well: &lt;STRONG&gt;If nmiss(of a1-a3 b1-b3)&amp;gt;0 Then...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I need to also check if any of the variables is zero. Therefore, I enhanced the If-clause accordingly: &lt;STRONG&gt;If nmiss(of a1-a3 b1-b3)&amp;gt;0 &lt;SPAN style="color: #ff0000;"&gt;or min(of a1-a3 b1-b3)=0&lt;/SPAN&gt; Then...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interestingly, this slows down processing time considerably (on my machine for &amp;gt;60 variables). Although I can live with that, I wonder if there's a better approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data zzz;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Input a1-a3 b1-b3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If nmiss(of a1-a3 b1-b3)=0 And min(of a1-a3 b1-b3)&amp;gt;0 Then Output;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Datalines;&lt;/P&gt;&lt;P&gt;1 2 3 4 5 6&lt;/P&gt;&lt;P&gt;1 . 3 4 5 6&lt;/P&gt;&lt;P&gt;1 2 3 4 0 6&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 07:34:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-for-special-values-in-numbered-range-lists/m-p/164196#M31752</guid>
      <dc:creator>Georg_UPB</dc:creator>
      <dc:date>2014-04-02T07:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: Check for special values in numbered range lists</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-for-special-values-in-numbered-range-lists/m-p/164197#M31753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could consider normalizing your data, so something like:&lt;/P&gt;&lt;P&gt;Section&amp;nbsp; Type&amp;nbsp; Value&lt;/P&gt;&lt;P&gt;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; A1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;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; A2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;3&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; B3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you could use SQL to sum and find missing values.&amp;nbsp; This may help with performance, however the secondary benefit of this is scalability.&amp;nbsp; So you have &amp;gt;60 variables at the moment, this is 60 rows per group, however what about 120, or more.&amp;nbsp; As for your example, I couldn't see any way of speeding it up other than that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 08:53:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-for-special-values-in-numbered-range-lists/m-p/164197#M31753</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-04-02T08:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: Check for special values in numbered range lists</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-for-special-values-in-numbered-range-lists/m-p/164198#M31754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your source data is in SAS tables, and if you want to subset your data with this condition, use WHERE instead,&lt;/P&gt;&lt;P&gt;Otherwise, I can't see any real alternative. Syntactically you could use an array instead, but it's very unlikely that it could be more efficient than built-in functions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 09:04:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-for-special-values-in-numbered-range-lists/m-p/164198#M31754</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-04-02T09:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Check for special values in numbered range lists</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-for-special-values-in-numbered-range-lists/m-p/164199#M31755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if it makes any difference, but you may try to replace two functions with only one "ORDINAL", &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;Data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; zzz;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;Input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; a1-a3 b1-b3;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;/*&amp;nbsp;&amp;nbsp;&amp;nbsp; If nmiss(of a1-a3 b1-b3)=0 And min(of a1-a3 b1-b3)&amp;gt;0;*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ordinal(1,of a1-a3 b1-b3) &amp;gt;&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;Datalines&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1 2 3 4 5 6&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1 . 3 4 5 6&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1 2 3 4 0 6&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;Run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Haikuo&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 09:27:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-for-special-values-in-numbered-range-lists/m-p/164199#M31755</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-04-02T09:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: Check for special values in numbered range lists</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Check-for-special-values-in-numbered-range-lists/m-p/164200#M31756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe it will be a bit faster if you split the expressions into two subsetting IFs.&amp;nbsp; This way MIN is only executed for observations that have no missing values.&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;Data&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; zzz2;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;Input&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; a1-a3 b1-b3;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; nmiss(of a1-a3 b1-b3) eq &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;0&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; min(of a1-a3 b1-b3) gt &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;0&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;Datalines&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffc0;"&gt;1 2 3 4 5 6&lt;BR /&gt;1 . 3 4 5 6&lt;BR /&gt;1 2 3 4 0 6&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;;;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;Run&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Apr 2014 09:38:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Check-for-special-values-in-numbered-range-lists/m-p/164200#M31756</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-04-02T09:38:48Z</dc:date>
    </item>
  </channel>
</rss>

