<?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: Creating a dummy variable in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482807#M31286</link>
    <description>Sorry, one more question:&lt;BR /&gt;&lt;BR /&gt;if this works, if weekday=1 then mon=1;&lt;BR /&gt;else mon=0;&lt;BR /&gt;&lt;BR /&gt;then how would I do if weekday=2,3,4 then TWT=1 ??</description>
    <pubDate>Tue, 31 Jul 2018 13:27:46 GMT</pubDate>
    <dc:creator>matt23</dc:creator>
    <dc:date>2018-07-31T13:27:46Z</dc:date>
    <item>
      <title>Creating a dummy variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482796#M31279</link>
      <description>&lt;P&gt;I am trying to create a dummy variable where if weekday=1, then Monday=1...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so far I have this:&lt;/P&gt;&lt;PRE&gt;data want
set have;
if weekday=1 then mon=1;
else mon=0;
run;&lt;/PRE&gt;&lt;P&gt;but this does not actually create the variable, what am I missing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 13:10:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482796#M31279</guid>
      <dc:creator>matt23</dc:creator>
      <dc:date>2018-07-31T13:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a dummy variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482799#M31280</link>
      <description>&lt;P&gt;We would need to see a (portion of) your data. We can't answer your question without it. (Or better yet, YOU look at the data and see if you can figure out why this simple code isn't working, before asking us. Don't actually ask us without YOU looking at the data first to see if you can figure it out)&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 13:13:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482799#M31280</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-07-31T13:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a dummy variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482800#M31281</link>
      <description>&lt;P&gt;Do you have a variable called weekday in your data? Or do you simply have a date variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the latter is the case, you should use the &lt;A href="https://v8doc.sas.com/sashtml/lgref/z0201173.htm" target="_self"&gt;WEEKDAY Function&lt;/A&gt; instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, always a good idea to specify what your data looks like&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 13:14:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482800#M31281</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-07-31T13:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a dummy variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482804#M31283</link>
      <description>I do have a variable called weekday that goes from 0 to 6</description>
      <pubDate>Tue, 31 Jul 2018 13:22:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482804#M31283</guid>
      <dc:creator>matt23</dc:creator>
      <dc:date>2018-07-31T13:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a dummy variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482805#M31284</link>
      <description>nvm I got it working</description>
      <pubDate>Tue, 31 Jul 2018 13:23:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482805#M31284</guid>
      <dc:creator>matt23</dc:creator>
      <dc:date>2018-07-31T13:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a dummy variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482806#M31285</link>
      <description>&lt;P&gt;Did you read the log?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are missing a semicolon at the end of the DATA statement.&amp;nbsp; Depending on the setting for system options, using SET as a data set name may or may not generate an error message.&amp;nbsp; You will have to check to see whether your original data set is intact or not.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 13:24:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482806#M31285</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-07-31T13:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a dummy variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482807#M31286</link>
      <description>Sorry, one more question:&lt;BR /&gt;&lt;BR /&gt;if this works, if weekday=1 then mon=1;&lt;BR /&gt;else mon=0;&lt;BR /&gt;&lt;BR /&gt;then how would I do if weekday=2,3,4 then TWT=1 ??</description>
      <pubDate>Tue, 31 Jul 2018 13:27:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482807#M31286</guid>
      <dc:creator>matt23</dc:creator>
      <dc:date>2018-07-31T13:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a dummy variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482810#M31288</link>
      <description>&lt;P&gt;if weekday in (2, 3, 4) then TWT=1;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 13:31:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482810#M31288</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-07-31T13:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a dummy variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482818#M31289</link>
      <description>how would I do that if I want a variables that is between two values like between 75 and 85? (75:85) only gives me full values but I have decimals in them so this doesn't work and the statement 'between' does not seem to work</description>
      <pubDate>Tue, 31 Jul 2018 13:42:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482818#M31289</guid>
      <dc:creator>matt23</dc:creator>
      <dc:date>2018-07-31T13:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a dummy variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482819#M31290</link>
      <description>&lt;P&gt;You have to stop telling us "doesn't work". You have to explain what happened and what you expected to happen. You have to show us the SASLOG.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 13:45:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482819#M31290</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-07-31T13:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a dummy variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482820#M31291</link>
      <description>&lt;PRE&gt;25         if weekday=0 then sun=1;
26         else sun=0;
27         if Temperature =&amp;lt; 75 then low=1;
28         else low=0;
29         if Temperature between 75 and 85 then mid=1;
                          _______
                          388
                          202
ERROR 388-185: Expecting an arithmetic operator.&lt;/PRE&gt;&lt;P&gt;I'm sorry, I just thought it would be enough&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;won't happen again&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 13:47:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482820#M31291</guid>
      <dc:creator>matt23</dc:creator>
      <dc:date>2018-07-31T13:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a dummy variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482849#M31298</link>
      <description>&lt;P&gt;if (75 &amp;lt;= var &amp;lt;= 85) then .......&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 15:17:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482849#M31298</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-07-31T15:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a dummy variable</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482940#M31309</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;if weekday in (2, 3, 4) then TWT=1;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Twt= weekday in (2, 3, 4);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Avoids need for Else twt=0.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 21:00:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-a-dummy-variable/m-p/482940#M31309</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-07-31T21:00:08Z</dc:date>
    </item>
  </channel>
</rss>

