<?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: Keeping data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Keeping-data/m-p/519200#M140580</link>
    <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Want;
set have;
where main_breed in ('HO', 'FR');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 06 Dec 2018 16:25:20 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2018-12-06T16:25:20Z</dc:date>
    <item>
      <title>Keeping data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-data/m-p/519199#M140579</link>
      <description>&lt;P&gt;Hil all&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm Looking for your help by using this code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;this variable&amp;nbsp;main_breed has many different names, I just want to keep only records that have HO and FR, So, I'm using this code and it worked perfectly&amp;nbsp;to keep HO bata by using main_breed information,&amp;nbsp;&lt;/P&gt;&lt;P&gt;my question&amp;nbsp;How I can keep HO and FR together by editing this code?&lt;/P&gt;&lt;P&gt;regards&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Want;
set have;
if main_breed  ne 'HO' then delete;
run;quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 16:23:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-data/m-p/519199#M140579</guid>
      <dc:creator>Barkamih</dc:creator>
      <dc:date>2018-12-06T16:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-data/m-p/519200#M140580</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Want;
set have;
where main_breed in ('HO', 'FR');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Dec 2018 16:25:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-data/m-p/519200#M140580</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-12-06T16:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-data/m-p/519201#M140581</link>
      <description>In and NOT IN. &lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p00iah2thp63bmn1lt20esag14lh.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p0xgxvo2we2mqrn1kteecpv1opx0" target="_blank"&gt;https://documentation.sas.com/?docsetId=lrcon&amp;amp;docsetTarget=p00iah2thp63bmn1lt20esag14lh.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p0xgxvo2we2mqrn1kteecpv1opx0&lt;/A&gt;</description>
      <pubDate>Thu, 06 Dec 2018 16:26:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-data/m-p/519201#M140581</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-06T16:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-data/m-p/519202#M140582</link>
      <description>&lt;P&gt;This code will write to the output where the main_breed is both HO and FR.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Want;
set have;
if main_breed  in ('HO','FR') ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Dec 2018 16:28:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-data/m-p/519202#M140582</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2018-12-06T16:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-data/m-p/519867#M140899</link>
      <description>&lt;P&gt;Try this.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Want;
set have;
where upcase(main_breed)  in ('HO','FR');
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I did:&lt;/P&gt;&lt;P&gt;#1. Remove the quit; statement.&amp;nbsp; Why?&amp;nbsp; It's not required in the data step.&lt;/P&gt;&lt;P&gt;#2. I replaced IF with a WHERE condition.&amp;nbsp; Why?&amp;nbsp;&amp;nbsp;IF or WHERE will work but I think WHERE is more appropriate.&lt;/P&gt;&lt;P&gt;#3. I include a character function&amp;nbsp;UPCASE.&amp;nbsp; Why?&amp;nbsp; This is to standardize the values to "HO" and "FR".&amp;nbsp; Unless "ho" and "HO" in your records&amp;nbsp;are 2 separate codes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, you might want to try PROC SQL.&amp;nbsp; Optionally, you can sort the records too by using the order by clause.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  create table WANT as
select * from HAVE
where upcase(main_breed) in ("HO","FR");
*order by &amp;lt;insert a variable to sort.  user comma to delimit the 2 or more variables&amp;gt;;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 09:06:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-data/m-p/519867#M140899</guid>
      <dc:creator>ShiroAmada</dc:creator>
      <dc:date>2018-12-10T09:06:17Z</dc:date>
    </item>
  </channel>
</rss>

