<?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: Array Question in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Array-Question/m-p/567720#M11571</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; This seems like a scenario where you could use ARRAY processing if you need to worry about consecutive values. What about data like this:&lt;/P&gt;
&lt;PRE&gt;1 1 1 1 0 1 1 1 T 
2 1 1 0 0 1 1 1 R 
3 1 1 0 0 0 1 1 R 
4 1 1 0 1 1 1 1 T 
5 0 1 1 1 1 1 1 T 
6 0 0 1 1 1 1 1 R 
7 1 1 1 1 1 1 1 T
8 1 0 1 0 1 0 1 ??&lt;/PRE&gt;
&lt;P&gt;I assume that 7 would be a T, but what about 8 -- it has three 0 values, but not consecutive.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jun 2019 18:07:10 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2019-06-20T18:07:10Z</dc:date>
    <item>
      <title>Array Question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Array-Question/m-p/567695#M11566</link>
      <description>Hi All, I have below dummy data set. I would like to achieve below result in the last column. Result column in T or R depending on the consecutive zero of the row DATA TEST; INPUT ID T1 T2 T3 T4 T5 T6 T7; CARDS; 1 1 1 1 0 1 1 1 2 1 1 0 0 1 1 1 3 1 1 0 0 0 1 1 4 1 1 0 1 1 1 1 5 0 1 1 1 1 1 1 6 0 0 1 1 1 1 1 ; RUN; Result will look like as below 1 1 1 1 0 1 1 1 T 2 1 1 0 0 1 1 1 R 3 1 1 0 0 0 1 1 R 4 1 1 0 1 1 1 1 T 5 0 1 1 1 1 1 1 T 6 0 0 1 1 1 1 1 R</description>
      <pubDate>Thu, 20 Jun 2019 16:21:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Array-Question/m-p/567695#M11566</guid>
      <dc:creator>umesh1</dc:creator>
      <dc:date>2019-06-20T16:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Array Question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Array-Question/m-p/567720#M11571</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; This seems like a scenario where you could use ARRAY processing if you need to worry about consecutive values. What about data like this:&lt;/P&gt;
&lt;PRE&gt;1 1 1 1 0 1 1 1 T 
2 1 1 0 0 1 1 1 R 
3 1 1 0 0 0 1 1 R 
4 1 1 0 1 1 1 1 T 
5 0 1 1 1 1 1 1 T 
6 0 0 1 1 1 1 1 R 
7 1 1 1 1 1 1 1 T
8 1 0 1 0 1 0 1 ??&lt;/PRE&gt;
&lt;P&gt;I assume that 7 would be a T, but what about 8 -- it has three 0 values, but not consecutive.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 18:07:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Array-Question/m-p/567720#M11571</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-06-20T18:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: Array Question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Array-Question/m-p/567732#M11572</link>
      <description>&lt;P&gt;Are the values only 0 and 1?&amp;nbsp; Are any missing?&lt;/P&gt;
&lt;P&gt;If so you could try converting them to a string and checking the string for the pattern.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if index(cats(of t1-t7),'000') then result='T';
else result='R';&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Jun 2019 18:50:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Array-Question/m-p/567732#M11572</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-06-20T18:50:42Z</dc:date>
    </item>
  </channel>
</rss>

