<?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: If-Then Statement help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/If-Then-Statement-help/m-p/777448#M247343</link>
    <description>WOW good catch! Its always the little things. I appreciate your help!</description>
    <pubDate>Sat, 30 Oct 2021 02:28:53 GMT</pubDate>
    <dc:creator>JibJam221</dc:creator>
    <dc:date>2021-10-30T02:28:53Z</dc:date>
    <item>
      <title>If-Then Statement help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-Then-Statement-help/m-p/777444#M247339</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to make a code that can help me recategorize my tables. The variables that will be conditioned are: Province and City. Basically, if Province is = to Toronto and the Province is Ontario, i'd like the region to be categorized as "Toronto". If province is = to Ontario and city is NOT equal to toronto, id like region to be categorized as "outside of toronto".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code I have:&amp;nbsp;&lt;/P&gt;&lt;P&gt;data work.tester2;&lt;/P&gt;&lt;P&gt;if province="ON" and city="torontp"&lt;BR /&gt;then&lt;BR /&gt;Region="Toronto";&lt;/P&gt;&lt;P&gt;else if province= "ON" and city^="toronto"&lt;BR /&gt;then Region="outside of toronto";&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when I run this code, all fields go blank.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Oct 2021 02:05:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-Then-Statement-help/m-p/777444#M247339</guid>
      <dc:creator>JibJam221</dc:creator>
      <dc:date>2021-10-30T02:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: If-Then Statement help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-Then-Statement-help/m-p/777445#M247340</link>
      <description>&lt;P&gt;Try removing your END statement and can only be used with a matching DO statement which you don't have.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check your SAS log for errors. What does it say?&lt;/P&gt;</description>
      <pubDate>Sat, 30 Oct 2021 02:12:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-Then-Statement-help/m-p/777445#M247340</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-10-30T02:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: If-Then Statement help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-Then-Statement-help/m-p/777446#M247341</link>
      <description>thanks for your help, when I remove the END, all columns delete and I am left with three blank columns: Province, City, and Region. I'm not sure what is going wrong, but there is no errors or notes in the log</description>
      <pubDate>Sat, 30 Oct 2021 02:17:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-Then-Statement-help/m-p/777446#M247341</guid>
      <dc:creator>JibJam221</dc:creator>
      <dc:date>2021-10-30T02:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: If-Then Statement help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-Then-Statement-help/m-p/777447#M247342</link>
      <description>&lt;P&gt;Ah, you aren't reading any data in. You need a SET statement to read in an existing SAS dataset.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Oct 2021 02:27:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-Then-Statement-help/m-p/777447#M247342</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-10-30T02:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: If-Then Statement help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-Then-Statement-help/m-p/777448#M247343</link>
      <description>WOW good catch! Its always the little things. I appreciate your help!</description>
      <pubDate>Sat, 30 Oct 2021 02:28:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-Then-Statement-help/m-p/777448#M247343</guid>
      <dc:creator>JibJam221</dc:creator>
      <dc:date>2021-10-30T02:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: If-Then Statement help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-Then-Statement-help/m-p/777455#M247348</link>
      <description>hello, quick question. I updated my code to categorize the entire dataset. Here is my code:&lt;BR /&gt;data work.tester4;&lt;BR /&gt;	set work.tester4;&lt;BR /&gt;&lt;BR /&gt;	if province="ON" and city="Toronto" then Region="Toronto";&lt;BR /&gt;	else if province= "ON" and city^="Toronto" then Region="Outside of Toronto";&lt;BR /&gt;	else if province="AB" and city="Calgary" then Region="Calgary";&lt;BR /&gt;	else if province="AB" and city^="Calgary" then Region="Outside of Calgary";&lt;BR /&gt;         else Region="N/A";&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;I am recieving the following error:&lt;BR /&gt;WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;is this a reason for concern? The warning is highlighted as the 'run;' statement. &lt;BR /&gt;&lt;BR /&gt;thanks</description>
      <pubDate>Sat, 30 Oct 2021 03:05:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-Then-Statement-help/m-p/777455#M247348</guid>
      <dc:creator>JibJam221</dc:creator>
      <dc:date>2021-10-30T03:05:12Z</dc:date>
    </item>
  </channel>
</rss>

