<?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: where statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/where-statement/m-p/754786#M238105</link>
    <description>&lt;PRE&gt;data vote;&lt;BR /&gt;set work.vote;&lt;BR /&gt;where candidate_id= (0301 and 0401);&lt;BR /&gt;proc print data=vote;&lt;BR /&gt;title 'Trump Clinton Votes'&lt;BR /&gt;run;&lt;/PRE&gt;</description>
    <pubDate>Sat, 17 Jul 2021 17:16:59 GMT</pubDate>
    <dc:creator>sassypixie</dc:creator>
    <dc:date>2021-07-17T17:16:59Z</dc:date>
    <item>
      <title>where statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/where-statement/m-p/754753#M238085</link>
      <description>&lt;P&gt;Trying again...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having trouble with a homework assignment. I need to remove rows using a where and set statement but I'm not sure how exactly to do that?&amp;nbsp; "In a second datastep remove the rows for all candidates except Trump and Clinton. Use a&lt;BR /&gt;set statement with a where statement." Any help would be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More info:&lt;/P&gt;&lt;P&gt;A text file called president election 2016.csv on the class website contains data on the 2016&lt;BR /&gt;presidential election by county within Minnesota. The first 5 records are as follows:&lt;BR /&gt;MN,1,AITKIN,0301,5516,9231&lt;BR /&gt;MN,1,AITKIN,0401,3134,9231&lt;BR /&gt;MN,1,AITKIN,0801,67,9231&lt;BR /&gt;MN,1,AITKIN,1101,124,9231&lt;BR /&gt;MN,1,AITKIN,1201,263,9231&lt;BR /&gt;There are 6 variables: 1) State abbreviation (MN on all records); 2) a county number (1-87);&lt;BR /&gt;3) name of county; 4) candidate code (0301=Trump, 0401=Clinton, 0801=Stein, 1101=McMullin,&lt;BR /&gt;1201=Johnson); 5) number of votes cast for that candidate in the county; 6) total votes cast in&lt;BR /&gt;that county. Note: There are five records for each county, one for each of the top 5 candidates.&lt;BR /&gt;Records for other candidates have been removed.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jul 2021 15:04:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/where-statement/m-p/754753#M238085</guid>
      <dc:creator>sassypixie</dc:creator>
      <dc:date>2021-07-17T15:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: where statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/where-statement/m-p/754782#M238102</link>
      <description>&lt;P&gt;Show us the code you have tried.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jul 2021 16:45:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/where-statement/m-p/754782#M238102</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-07-17T16:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: where statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/where-statement/m-p/754783#M238103</link>
      <description>&lt;P&gt;First you will need to read in the csv file. I would use proc import for that. The where statement is used for sub setting. You need to make the where condition where candidate code IN (0301, 0401).&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jul 2021 17:24:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/where-statement/m-p/754783#M238103</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-07-17T17:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: where statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/where-statement/m-p/754786#M238105</link>
      <description>&lt;PRE&gt;data vote;&lt;BR /&gt;set work.vote;&lt;BR /&gt;where candidate_id= (0301 and 0401);&lt;BR /&gt;proc print data=vote;&lt;BR /&gt;title 'Trump Clinton Votes'&lt;BR /&gt;run;&lt;/PRE&gt;</description>
      <pubDate>Sat, 17 Jul 2021 17:16:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/where-statement/m-p/754786#M238105</guid>
      <dc:creator>sassypixie</dc:creator>
      <dc:date>2021-07-17T17:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: where statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/where-statement/m-p/754788#M238107</link>
      <description>&lt;P&gt;Did you try to run this? It looks like it will make an error in the log. Try this:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data vote;
set work.vote;
where candidate_id in (0301,0401);
proc print data=vote;
title 'Trump Clinton Votes'
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 17 Jul 2021 17:21:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/where-statement/m-p/754788#M238107</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-07-17T17:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: where statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/where-statement/m-p/754789#M238108</link>
      <description>&lt;P&gt;That worked! Thank you very much.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jul 2021 17:25:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/where-statement/m-p/754789#M238108</guid>
      <dc:creator>sassypixie</dc:creator>
      <dc:date>2021-07-17T17:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: where statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/where-statement/m-p/754790#M238109</link>
      <description>&lt;P&gt;Happy to help. I don't think you can use the = like that. It would have to be where candidate_id = 0301 or candidate_id = 0401. If you want less typing, then use the in operator.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jul 2021 17:27:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/where-statement/m-p/754790#M238109</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-07-17T17:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: where statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/where-statement/m-p/754792#M238110</link>
      <description>&lt;P&gt;Thank you again! That was very helpful! Would it be possible for me to message you another question I have?&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jul 2021 17:39:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/where-statement/m-p/754792#M238110</guid>
      <dc:creator>sassypixie</dc:creator>
      <dc:date>2021-07-17T17:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: where statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/where-statement/m-p/754793#M238111</link>
      <description>&lt;P&gt;Go for it. I genuinely like helping people on here and trust me there's other things I could be doing on Saturday lol.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jul 2021 17:40:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/where-statement/m-p/754793#M238111</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-07-17T17:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: where statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/where-statement/m-p/754795#M238112</link>
      <description>&lt;P&gt;Hmm it says I've reach my max number of private messages I can send for now, but I've never sent anyone a private message soo I guess I'll try again later? lol thank you again&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jul 2021 17:57:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/where-statement/m-p/754795#M238112</guid>
      <dc:creator>sassypixie</dc:creator>
      <dc:date>2021-07-17T17:57:43Z</dc:date>
    </item>
  </channel>
</rss>

