<?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 Subsetting Data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-Data/m-p/384405#M91781</link>
    <description>&lt;P&gt;Hi, I need to identify which observations have a certain value.&lt;/P&gt;
&lt;P&gt;I tried the code below but am getting the error message 'array subscript out of range'.&lt;/P&gt;
&lt;PRE&gt;data check;
set all;
array pct  con_pct t_pct pm_pct pb_pct oth_pct;
if pct(i) in ('G1%', 'G2%', 'G5%');
run;&lt;/PRE&gt;
&lt;P&gt;What am I doing wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 31 Jul 2017 19:34:57 GMT</pubDate>
    <dc:creator>jcis7</dc:creator>
    <dc:date>2017-07-31T19:34:57Z</dc:date>
    <item>
      <title>Subsetting Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-Data/m-p/384405#M91781</link>
      <description>&lt;P&gt;Hi, I need to identify which observations have a certain value.&lt;/P&gt;
&lt;P&gt;I tried the code below but am getting the error message 'array subscript out of range'.&lt;/P&gt;
&lt;PRE&gt;data check;
set all;
array pct  con_pct t_pct pm_pct pb_pct oth_pct;
if pct(i) in ('G1%', 'G2%', 'G5%');
run;&lt;/PRE&gt;
&lt;P&gt;What am I doing wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 19:34:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-Data/m-p/384405#M91781</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2017-07-31T19:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-Data/m-p/384407#M91783</link>
      <description>&lt;P&gt;The obvious issue is that you have NOT set a value for variable i. There may be other problems as well.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 19:37:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-Data/m-p/384407#M91783</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-07-31T19:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-Data/m-p/384415#M91786</link>
      <description>&lt;P&gt;Are you expecting the percent (%) sign to act as a wildcard? That won't work, it will check for exactly that string. If you're looking for strings that start with those components consider the colon. But TEST it out thoroughly for their needs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;do i=1 to dim(pct);
if pct(i) in: ('G1', 'G2', 'G5') then flag=1;
end;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Jul 2017 19:57:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-Data/m-p/384415#M91786</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-31T19:57:34Z</dc:date>
    </item>
  </channel>
</rss>

