<?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 Data subsetting in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Data-subsetting/m-p/614446#M179622</link>
    <description>&lt;P&gt;I have the following data:&lt;/P&gt;&lt;P&gt;a &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; b &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c&lt;/P&gt;&lt;P&gt;nrename &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; test1.nm7 &amp;nbsp; &amp;nbsp;&amp;nbsp; 0test1.nm7&lt;/P&gt;&lt;P&gt;nrename &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; test2.nm7 &amp;nbsp; &amp;nbsp;&amp;nbsp; 1test2.nm7&lt;/P&gt;&lt;P&gt;nrename &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; test3.nm7 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0test3.nm7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What type of keep statement do I need that will allow me to keep only those rows which contain 1testi.nm7?&lt;/P&gt;&lt;P&gt;I plan to handle the i with a do loop but not sure how to keep a&amp;nbsp; character statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I saw a post that gave the statement ,if sym_suffix in ('A', ' ');&lt;/P&gt;&lt;P&gt;When I tried&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 
     
data new;    
SET NEWB;
 if prefix in (1, ' '); 
 run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;DIV&gt;&lt;DIV class="sasSource"&gt;&lt;DIV&gt;&lt;DIV class="sasSource"&gt;I get the following error.&amp;nbsp; What statement can I use to keep character data with the 1 prefix?&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="sasSource"&gt;74 data new;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;75 SET NEWB;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;76 if prefix in (1, ' ');&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR: All variables in array list must be the same type, i.e., all numeric or character.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;77 run;&lt;/DIV&gt;&lt;/DIV&gt;&lt;PRE class="sasLog"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;PRE class="sasLog"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Dec 2019 18:40:30 GMT</pubDate>
    <dc:creator>jacksonan123</dc:creator>
    <dc:date>2019-12-30T18:40:30Z</dc:date>
    <item>
      <title>Data subsetting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-subsetting/m-p/614446#M179622</link>
      <description>&lt;P&gt;I have the following data:&lt;/P&gt;&lt;P&gt;a &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; b &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c&lt;/P&gt;&lt;P&gt;nrename &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; test1.nm7 &amp;nbsp; &amp;nbsp;&amp;nbsp; 0test1.nm7&lt;/P&gt;&lt;P&gt;nrename &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; test2.nm7 &amp;nbsp; &amp;nbsp;&amp;nbsp; 1test2.nm7&lt;/P&gt;&lt;P&gt;nrename &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; test3.nm7 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0test3.nm7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What type of keep statement do I need that will allow me to keep only those rows which contain 1testi.nm7?&lt;/P&gt;&lt;P&gt;I plan to handle the i with a do loop but not sure how to keep a&amp;nbsp; character statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I saw a post that gave the statement ,if sym_suffix in ('A', ' ');&lt;/P&gt;&lt;P&gt;When I tried&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 
     
data new;    
SET NEWB;
 if prefix in (1, ' '); 
 run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;DIV&gt;&lt;DIV class="sasSource"&gt;&lt;DIV&gt;&lt;DIV class="sasSource"&gt;I get the following error.&amp;nbsp; What statement can I use to keep character data with the 1 prefix?&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="sasSource"&gt;74 data new;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;75 SET NEWB;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;76 if prefix in (1, ' ');&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR: All variables in array list must be the same type, i.e., all numeric or character.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;77 run;&lt;/DIV&gt;&lt;/DIV&gt;&lt;PRE class="sasLog"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;PRE class="sasLog"&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2019 18:40:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-subsetting/m-p/614446#M179622</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2019-12-30T18:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: Data subsetting</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-subsetting/m-p/614447#M179623</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input (a                        b                       c) (:$10.);
cards;
nrename        test1.nm7      0test1.nm7
nrename        test2.nm7      1test2.nm7
nrename        test3.nm7       0test3.nm7
;

data want;
set have;
array t b--c;
do over t;
 if first(t) in (' ', '1') then f=1;
end;
if f;
drop f; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;array t b--c;&lt;/P&gt;
&lt;P&gt;This means we are grouping variables starting from b and anything between b and c, including c. HTH&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2019 18:51:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-subsetting/m-p/614447#M179623</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-12-30T18:51:51Z</dc:date>
    </item>
  </channel>
</rss>

