<?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: Selecting rows from a dataset to another one with condition in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Selecting-rows-from-a-dataset-to-another-one-with-condition/m-p/345692#M79566</link>
    <description>&lt;P&gt;If I understand you correctly, you want a subset of your dataset named dates, that contains the ID and your 'd' variable if neither one of the 54 year variables are equal to 2017? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Otherwise, please clarify?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 30 Mar 2017 09:13:41 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2017-03-30T09:13:41Z</dc:date>
    <item>
      <title>Selecting rows from a dataset to another one with condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-rows-from-a-dataset-to-another-one-with-condition/m-p/345691#M79565</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data set called dates containing multiple date variables. I created variables d1 to d54 containing these date variables' years.&lt;/P&gt;&lt;P&gt;I woul like to get the id and the "d" variable if the year is not equal to 2017.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know if i'm clear enough.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank for help.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 09:10:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-rows-from-a-dataset-to-another-one-with-condition/m-p/345691#M79565</guid>
      <dc:creator>indox</dc:creator>
      <dc:date>2017-03-30T09:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting rows from a dataset to another one with condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-rows-from-a-dataset-to-another-one-with-condition/m-p/345692#M79566</link>
      <description>&lt;P&gt;If I understand you correctly, you want a subset of your dataset named dates, that contains the ID and your 'd' variable if neither one of the 54 year variables are equal to 2017? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Otherwise, please clarify?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 09:13:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-rows-from-a-dataset-to-another-one-with-condition/m-p/345692#M79566</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-03-30T09:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting rows from a dataset to another one with condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-rows-from-a-dataset-to-another-one-with-condition/m-p/345693#M79567</link>
      <description>&lt;P&gt;Yes, this is what i want.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 09:20:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-rows-from-a-dataset-to-another-one-with-condition/m-p/345693#M79567</guid>
      <dc:creator>indox</dc:creator>
      <dc:date>2017-03-30T09:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting rows from a dataset to another one with condition</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-rows-from-a-dataset-to-another-one-with-condition/m-p/345694#M79568</link>
      <description>&lt;P&gt;Something like this? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID d1 d2 d3 d4;
datalines;
1 2016 2017 2013 2011
2 2014 2013 2010 2009
3 2013 2011 2017 2008
4 2015 2015 2007 2008
5 2017 2008 2007 2013
;

data want;
   set have;
   array years[*] d1-d4;

   do i = 1 to dim(years);
      if years[i] = 2017 then output;
   end;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Mar 2017 09:31:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-rows-from-a-dataset-to-another-one-with-condition/m-p/345694#M79568</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-03-30T09:31:33Z</dc:date>
    </item>
  </channel>
</rss>

