<?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: Using Array variable with AND in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-Array-variable-with-AND/m-p/284648#M58069</link>
    <description>&lt;P&gt;Hi:&lt;BR /&gt; I'm curious about the DX1-DX10 variables are they character or numeric? generally, you don't use substr on a numeric variable. So I'm sort of surprised that your left(trim(substr isn't giving your automatic conversion messages in the log:&lt;BR /&gt;NOTE: Numeric values have been converted to character values at the places given by: (Line) : (Column).&lt;BR /&gt;NOTE: Character values have been converted to numeric values at the places given by: (Line) : (Column).&lt;BR /&gt;&lt;BR /&gt;Aside from any issues of your date values in the IF, problems with the substr function could cause the IF not to work correctly.&lt;BR /&gt;&lt;BR /&gt;cynthia&lt;/P&gt;</description>
    <pubDate>Thu, 14 Jul 2016 19:30:52 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2016-07-14T19:30:52Z</dc:date>
    <item>
      <title>Using Array variable with AND</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Array-variable-with-AND/m-p/284636#M58067</link>
      <description>&lt;P&gt;I'm using the code below to find is a patient who had an appendectomy also had a diagnosis of appendicitis within 30 days of the procedure. The code below doesn't seem to be working as expected. It is correctly flagging those with a diagnosis but not the 30-day AND part. Can anyone spot what's wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; array dx[&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;10&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;] DX1 - DX10;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; appdx_flag = &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; chronic_flag = &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; do i = &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; to &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;10&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp; if (&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;left(trim(substr(dx[i],&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;5&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;))) in (&amp;amp;AppICD9Codes4)) and (ENC_DATE - DxWindow) &amp;lt;= &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;30&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; then&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; appdx_flag = &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Brian&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2016 19:09:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Array-variable-with-AND/m-p/284636#M58067</guid>
      <dc:creator>BTAinRVA</dc:creator>
      <dc:date>2016-07-14T19:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using Array variable with AND</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Array-variable-with-AND/m-p/284648#M58069</link>
      <description>&lt;P&gt;Hi:&lt;BR /&gt; I'm curious about the DX1-DX10 variables are they character or numeric? generally, you don't use substr on a numeric variable. So I'm sort of surprised that your left(trim(substr isn't giving your automatic conversion messages in the log:&lt;BR /&gt;NOTE: Numeric values have been converted to character values at the places given by: (Line) : (Column).&lt;BR /&gt;NOTE: Character values have been converted to numeric values at the places given by: (Line) : (Column).&lt;BR /&gt;&lt;BR /&gt;Aside from any issues of your date values in the IF, problems with the substr function could cause the IF not to work correctly.&lt;BR /&gt;&lt;BR /&gt;cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2016 19:30:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Array-variable-with-AND/m-p/284648#M58069</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-07-14T19:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using Array variable with AND</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Array-variable-with-AND/m-p/284650#M58070</link>
      <description>&lt;P&gt;You should provide some example data. You don't show what types of values ENC_DATE and DxWindow are or what the values look like. Some of the more common questions relate to date values and if your variables are not actually date values then the subtraction would likely be incorrect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So provide some example data, best in the form of a datastep so we can test code. This link&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;shows one way to turn your dataset into a data step.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2016 19:38:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Array-variable-with-AND/m-p/284650#M58070</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-07-14T19:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using Array variable with AND</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Array-variable-with-AND/m-p/284652#M58071</link>
      <description>&lt;P&gt;If you give two or three records(even fictious), then it will easy to visualize the problem. You use IN function with a macro variable. Is it a list?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2016 19:39:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Array-variable-with-AND/m-p/284652#M58071</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2016-07-14T19:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using Array variable with AND</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Array-variable-with-AND/m-p/284693#M58087</link>
      <description>ballardw,&lt;BR /&gt;Thanks for the link. I'll try using that macro tomorrow.&lt;BR /&gt;&lt;BR /&gt;Cynthia,&lt;BR /&gt;The dx variables are character.</description>
      <pubDate>Thu, 14 Jul 2016 21:22:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Array-variable-with-AND/m-p/284693#M58087</guid>
      <dc:creator>BTAinRVA</dc:creator>
      <dc:date>2016-07-14T21:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using Array variable with AND</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Array-variable-with-AND/m-p/284694#M58088</link>
      <description>datasp,&lt;BR /&gt;Yes, the macro variables are lists of diagnosis codes</description>
      <pubDate>Thu, 14 Jul 2016 21:25:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Array-variable-with-AND/m-p/284694#M58088</guid>
      <dc:creator>BTAinRVA</dc:creator>
      <dc:date>2016-07-14T21:25:00Z</dc:date>
    </item>
  </channel>
</rss>

