<?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: Informats and Dates in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Informats-and-Dates/m-p/141475#M37743</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;new_date=input(put(date,6.),yymmn6.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update: this will assume you the first day of the month. if you want some other days, you want to take a look at MDY() plus substr(). &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Mar 2014 19:08:50 GMT</pubDate>
    <dc:creator>Haikuo</dc:creator>
    <dc:date>2014-03-12T19:08:50Z</dc:date>
    <item>
      <title>Informats and Dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Informats-and-Dates/m-p/141474#M37742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Probably a very newbie question, but I can't seem to get anything to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an existing dataset (got from someone else) with a column of "dates" with values such as 199301 (meaning January of 1993).&amp;nbsp; The values appear to be stored as BEST 12, though, so that when I try to use them as dates I get a whole bunch of very funny results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My understanding is that I need to change the numbers to characters and then read them back in as SAS dates, but haven't had any luck.&amp;nbsp; I've tried code like the following, but either get errors or the new dates come out as missing:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;D2 = input(put(yyyymm, Z6.) , YYMMDD6.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&amp;nbsp; Really, all I want to do is change the 199301 (stored as Best 12) into 199301 (stored as a date).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 18:51:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Informats-and-Dates/m-p/141474#M37742</guid>
      <dc:creator>yeaforme</dc:creator>
      <dc:date>2014-03-12T18:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Informats and Dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Informats-and-Dates/m-p/141475#M37743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;new_date=input(put(date,6.),yymmn6.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update: this will assume you the first day of the month. if you want some other days, you want to take a look at MDY() plus substr(). &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 19:08:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Informats-and-Dates/m-p/141475#M37743</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-03-12T19:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Informats and Dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Informats-and-Dates/m-p/141476#M37744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The underlying date will actually be January 1, 1993&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right idea though, wrong execution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input date_num;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;199301&lt;/P&gt;&lt;P&gt;199302&lt;/P&gt;&lt;P&gt;199303&lt;/P&gt;&lt;P&gt;199304&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;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;date_format=input(put(date_num, 6. -l), yymmn6.);&lt;/P&gt;&lt;P&gt;format date_format yymmn6.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 19:09:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Informats-and-Dates/m-p/141476#M37744</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-03-12T19:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Informats and Dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Informats-and-Dates/m-p/141477#M37745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks - worked like a charm.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 19:29:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Informats-and-Dates/m-p/141477#M37745</guid>
      <dc:creator>yeaforme</dc:creator>
      <dc:date>2014-03-12T19:29:23Z</dc:date>
    </item>
  </channel>
</rss>

