<?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: Addind a dummy variable in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120336#M4629</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about using day of week name (&lt;STRONG&gt;downame)&lt;/STRONG&gt; format.&amp;nbsp; Something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;your_dummy_variable = &lt;/STRONG&gt; (put(&lt;STRONG&gt;your_date_variable,&lt;/STRONG&gt;downame.) = 'Monday' ) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note this assumes your date variable is actually a sas date value and not a sas datetime value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Nov 2012 22:25:46 GMT</pubDate>
    <dc:creator>LarryWorley</dc:creator>
    <dc:date>2012-11-07T22:25:46Z</dc:date>
    <item>
      <title>Addind a dummy variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120335#M4628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a data set which contains daily data. I need to fit an ARCH model to this data set.&lt;/P&gt;&lt;P&gt;How can I add a dummy variable to the heteroskedastic error part of garch model (sigma squared) so that the dummy variable equals to 1 for every Monday?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2012 22:17:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120335#M4628</guid>
      <dc:creator>malakaext</dc:creator>
      <dc:date>2012-11-07T22:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: Addind a dummy variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120336#M4629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about using day of week name (&lt;STRONG&gt;downame)&lt;/STRONG&gt; format.&amp;nbsp; Something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;your_dummy_variable = &lt;/STRONG&gt; (put(&lt;STRONG&gt;your_date_variable,&lt;/STRONG&gt;downame.) = 'Monday' ) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note this assumes your date variable is actually a sas date value and not a sas datetime value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2012 22:25:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120336#M4629</guid>
      <dc:creator>LarryWorley</dc:creator>
      <dc:date>2012-11-07T22:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Addind a dummy variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120337#M4630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A slight refinement from Larry's suggestion would be to use the weekday and IFN functions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;do date = '01nov12'd to '20nov12'd;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; flag = IFN(weekday(date)=2,1,0,.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; put date date9. date flag;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2012 06:46:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120337#M4630</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2012-11-08T06:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Addind a dummy variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120338#M4631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. But it gives me the following error:(I'm using SAS 9.0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; data test;&lt;/P&gt;&lt;P&gt;45&lt;/P&gt;&lt;P&gt;46&amp;nbsp;&amp;nbsp; do date = '01nov12'd to '20nov12'd;&lt;/P&gt;&lt;P&gt;47&lt;/P&gt;&lt;P&gt;48&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flag = IFN(weekday(date)=2,1,0,.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 68&lt;/P&gt;&lt;P&gt;ERROR 68-185: The function IFN is unknown, or cannot be accessed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Malaka&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2012 02:23:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120338#M4631</guid>
      <dc:creator>malakaext</dc:creator>
      <dc:date>2012-11-09T02:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Addind a dummy variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120339#M4632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So just use a normal IF/THEN/ELSE statement.&amp;nbsp; I am really not sure why anyone uses the IFN function anyway as it just adds confusion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;if weekday(date)=2 then flag=1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;else flag=0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or since SAS will generate boolean 0/1 values when evaluating logic equations why not just use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;flag = (weekday(date)= 2);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2012 03:34:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120339#M4632</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-11-09T03:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: Addind a dummy variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120340#M4633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="2431" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;: I've gotten into the habit of using the ifn function because it removes so much confusion when dealing with lags (e.g.: &lt;A class="active_link" href="http://www.sascommunity.org/wiki/Conditional_Use_of_LAG" title="http://www.sascommunity.org/wiki/Conditional_Use_of_LAG"&gt;http://www.sascommunity.org/wiki/Conditional_Use_of_LAG )&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2012 03:45:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120340#M4633</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-11-09T03:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Addind a dummy variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120341#M4634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please see why the following code doesnt generate what I want&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile "F:\data\ftse.csv"&amp;nbsp; DSD MISSOVER;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input date open high low close returns d;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set test;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do date = '01nov12'd to '20nov12'd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if weekday(date)=2 then flag=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; put date date9. date flag;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data = test;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2012 04:06:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120341#M4634</guid>
      <dc:creator>malakaext</dc:creator>
      <dc:date>2012-11-09T04:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: Addind a dummy variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120342#M4635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are missing:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else flag=0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inside a DO loop, there is nothing in your code that resets FLAG.&amp;nbsp; Once it gets set to 1, it remains 1 for the rest of the loop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2012 04:34:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120342#M4635</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-11-09T04:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: Addind a dummy variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120343#M4636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm still not getting the results I need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used the following code and Used a SMALL DATA SET(attached)&lt;/P&gt;&lt;P&gt;I need a new column added to the data set in which entry = 1 if the day is MONDAY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please CORRECT the following Code. (NEW data set attached)&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;P.S. Why does the first row of the created data set contain "." s..?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile "F:\data\ftse1.csv"&amp;nbsp; DSD MISSOVER;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input date open high low close returns;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;set test;&lt;/P&gt;&lt;P&gt;do date = '02jan90'd to '26jan90'd;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if weekday(date)=1 then flag=1; else&amp;nbsp; flag=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; put date date9. date flag;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print data = test;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2012 20:51:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120343#M4636</guid>
      <dc:creator>malakaext</dc:creator>
      <dc:date>2012-11-09T20:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: Addind a dummy variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120344#M4637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure what you are trying to accomplish.&amp;nbsp; However, you are getting the missing row because you aren't account for the first row containing the variable names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That said, your code tries to read dates, among other things, then replaces that data with another date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the following all you are trying to do?:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= WORK.TEST &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATAFILE= "C:\ftse1.csv" &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBMS=CSV REPLACE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GETNAMES=YES;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATAROW=2; &lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format date date9.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set test (rename=(date=_date));&lt;/P&gt;&lt;P&gt;&amp;nbsp; date=input(substr(_date,find(_date,"y,")+3),anydtdte25.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if weekday(date)=2 then flag=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else&amp;nbsp; flag=0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2012 21:22:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120344#M4637</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-11-09T21:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Addind a dummy variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120345#M4638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;all I want to do is to add a new column to that attached data set so that the new column contains 1 if the corresponding day is a Monday and zero other wise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please send me a code that does this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am still trying to understand this so its kind of hard to do it my self.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2012 21:32:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120345#M4638</guid>
      <dc:creator>malakaext</dc:creator>
      <dc:date>2012-11-09T21:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: Addind a dummy variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120346#M4639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art's code does exactly what you are asking for.&amp;nbsp; It adds the column called flag which has the requested values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But at the risk of sounding pedogic, you need to understand what you are doing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The purpose of forums like this is to share knowledge and help neophytes understand how to use SAS efficiently, not to get someone to write your homework or business assignment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMHO, it would help you to understand the changes which Art suggested.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2012 21:41:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120346#M4639</guid>
      <dc:creator>LarryWorley</dc:creator>
      <dc:date>2012-11-09T21:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Addind a dummy variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120347#M4640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I understand what exactly you are saying. I am trying to learn it. I am still new to SAS.&lt;/P&gt;&lt;P&gt;Any way I appreciate your input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2012 21:55:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120347#M4640</guid>
      <dc:creator>malakaext</dc:creator>
      <dc:date>2012-11-09T21:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: Addind a dummy variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120348#M4641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The only thing you may have to change in the code I sent is the statement that identifies the file you are importing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Rather than:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;PROC IMPORT OUT= WORK.TEST&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATAFILE= "C:\ftse1.csv"&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBMS=CSV REPLACE;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GETNAMES=YES;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATAROW=2;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;RUN;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;it should read:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;PROC IMPORT OUT= WORK.TEST&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATAFILE= "&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;F:\data&lt;/SPAN&gt;\ftse1.csv"&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBMS=CSV REPLACE;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GETNAMES=YES;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATAROW=2;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The proc import reads your csv file and, in the process, gets the variable names.&amp;nbsp; Unfortunately, the date field is imported as text and I can't think of an informat that can correctly understand a date like "Frday, November 9, 2012" which is how the dates are represented in the file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As such, I renamed the date field to be _date and then created a date field with the statement:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; date=input(substr(_date,find(_date,"y,")+3),anydtdte25.)&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The substr part gets everything to the right of the day names, and then the input function inputs the field using the anydtdte25. informat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2012 23:06:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120348#M4641</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-11-09T23:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Addind a dummy variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120349#M4642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you read in the CSV file and just keep the DATE field as a character string you can also create the new flag be just testing if the string starts with Monday.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if you read it using Art's PROC IMPORT into a dataset named TEST then you can create a new dataset named WANT with the extra variable (column) named FLAG with this simple program.&amp;nbsp; The colon after the equal sign tells SAS to match strings up to the length of the shorter of the two.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;data want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;&amp;nbsp; set test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;&amp;nbsp; flag = (date =: 'Monday') ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your real data is messier than the sample so that it has mixed case text for the day of the week then you might want to include a LOWCASE() function call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;data want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;&amp;nbsp; set test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;&amp;nbsp; flag = (lowcase(date) =: 'monday') ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Nov 2012 00:35:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120349#M4642</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-11-10T00:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: Addind a dummy variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120350#M4643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I like the idea of not only using a dummy variable, but also being able to engage in using &lt;/P&gt;&lt;P&gt;precise effects with the coding of three variables, 1 ,0, and -1.&amp;nbsp; Very interesting and most helpful.&amp;nbsp; Effect coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Patrice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Nov 2012 14:30:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Addind-a-dummy-variable/m-p/120350#M4643</guid>
      <dc:creator>prasmussen</dc:creator>
      <dc:date>2012-11-10T14:30:45Z</dc:date>
    </item>
  </channel>
</rss>

