<?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 Problems with dates for a beginner in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problems-with-dates-for-a-beginner/m-p/445378#M111592</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have just started on SAS and have converted a text file and done multiple manipulations with it including changing dates into a relavant format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a question, I want to recode one date point (data point 555) from 21/05/2006 to the 15/05/2006 and every method I use ends up with 1/1/1960. I have converted everything to the ddmmyy10. format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example;&lt;/P&gt;&lt;P&gt;data sunscreen;&lt;/P&gt;&lt;P&gt;modify sunscreen;&lt;/P&gt;&lt;P&gt;if studyid=555 then melanomadate = 15/05/2006;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This ends up with 1/1/1960&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I then tried&lt;/P&gt;&lt;P&gt;For example;&lt;/P&gt;&lt;P&gt;data sunscreen;&lt;/P&gt;&lt;P&gt;modify sunscreen;&lt;/P&gt;&lt;P&gt;if studyid=555 then melanomadate = ('15/05/2006', ddmmyy10.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And got error,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts/ideas?&lt;/P&gt;</description>
    <pubDate>Wed, 14 Mar 2018 04:14:11 GMT</pubDate>
    <dc:creator>underarmnat</dc:creator>
    <dc:date>2018-03-14T04:14:11Z</dc:date>
    <item>
      <title>Problems with dates for a beginner</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problems-with-dates-for-a-beginner/m-p/445378#M111592</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have just started on SAS and have converted a text file and done multiple manipulations with it including changing dates into a relavant format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a question, I want to recode one date point (data point 555) from 21/05/2006 to the 15/05/2006 and every method I use ends up with 1/1/1960. I have converted everything to the ddmmyy10. format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example;&lt;/P&gt;&lt;P&gt;data sunscreen;&lt;/P&gt;&lt;P&gt;modify sunscreen;&lt;/P&gt;&lt;P&gt;if studyid=555 then melanomadate = 15/05/2006;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This ends up with 1/1/1960&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I then tried&lt;/P&gt;&lt;P&gt;For example;&lt;/P&gt;&lt;P&gt;data sunscreen;&lt;/P&gt;&lt;P&gt;modify sunscreen;&lt;/P&gt;&lt;P&gt;if studyid=555 then melanomadate = ('15/05/2006', ddmmyy10.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And got error,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts/ideas?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 04:14:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problems-with-dates-for-a-beginner/m-p/445378#M111592</guid>
      <dc:creator>underarmnat</dc:creator>
      <dc:date>2018-03-14T04:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with dates for a beginner</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problems-with-dates-for-a-beginner/m-p/445380#M111594</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN&gt;melanomadate = '15may2006'd;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 04:16:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problems-with-dates-for-a-beginner/m-p/445380#M111594</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-03-14T04:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with dates for a beginner</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problems-with-dates-for-a-beginner/m-p/445381#M111595</link>
      <description>Thank you, works!&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Mar 2018 04:20:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problems-with-dates-for-a-beginner/m-p/445381#M111595</guid>
      <dc:creator>underarmnat</dc:creator>
      <dc:date>2018-03-14T04:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with dates for a beginner</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problems-with-dates-for-a-beginner/m-p/445384#M111597</link>
      <description>&lt;P&gt;&lt;SPAN&gt;15/05/2006 performs a division. The result is about 0, which is 01/01/1960&amp;nbsp;as a&amp;nbsp;sas date.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Mar 2018 04:54:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problems-with-dates-for-a-beginner/m-p/445384#M111597</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-03-14T04:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with dates for a beginner</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problems-with-dates-for-a-beginner/m-p/445419#M111612</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/198999"&gt;@underarmnat&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Your 2nd attempt was actually pretty close. You just forgot to also use the SAS INPUT() function to tell SAS what it should be doing with the date string and the informat.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  melanomadate = input('15/05/2006', ddmmyy10.);
  format melomadate ddmmyy10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Mar 2018 09:14:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problems-with-dates-for-a-beginner/m-p/445419#M111612</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-03-14T09:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with dates for a beginner</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problems-with-dates-for-a-beginner/m-p/445421#M111613</link>
      <description>Thanks for your help Patrick&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Mar 2018 09:18:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problems-with-dates-for-a-beginner/m-p/445421#M111613</guid>
      <dc:creator>underarmnat</dc:creator>
      <dc:date>2018-03-14T09:18:37Z</dc:date>
    </item>
  </channel>
</rss>

