<?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: About  SAS dates conversions in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37388#M7395</link>
    <description>Thanks. In other words, I can convert any numeric to SAS dates?</description>
    <pubDate>Thu, 28 May 2009 14:27:57 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-05-28T14:27:57Z</dc:date>
    <item>
      <title>About  SAS dates conversions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37384#M7391</link>
      <description>Only some numerics can be converted to SAS dates directly right? Such as, mmddyy, 040609? You can use format mmddyy8.&lt;BR /&gt;
&lt;BR /&gt;
But there are special cases where you can't convert them directly and need to go through an extra step rgith? Such as, yyyymmdd, 20090406? You have to convert 20090406 to character using put then convert it to date right?&lt;BR /&gt;
&lt;BR /&gt;
I just want to make sure if I understand this correctly. Conclusion is that only some numerics can be converted to SAS date directly?&lt;BR /&gt;
&lt;BR /&gt;
thanks.</description>
      <pubDate>Wed, 27 May 2009 17:32:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37384#M7391</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-27T17:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: About  SAS dates conversions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37385#M7392</link>
      <description>There is the SAS INFORMAT (not format) called ANYDTDTE. which is a bit more forgiving.  Here's a sample code snippet to demonstrate:&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
length cdt $10;&lt;BR /&gt;
format dt date9.;&lt;BR /&gt;
cdt = '2005/01/01';&lt;BR /&gt;
dt = input(cdt,anydtdte10.);&lt;BR /&gt;
putlog _all_;&lt;BR /&gt;
/* need to consider YEARCUTOFF= for these */&lt;BR /&gt;
cdt = '01/01/99';&lt;BR /&gt;
dt = input(cdt,anydtdte10.);&lt;BR /&gt;
putlog _all_;&lt;BR /&gt;
cdt = '1/1/1';  &lt;BR /&gt;
dt = input(cdt,anydtdte10.);&lt;BR /&gt;
putlog _all_;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 27 May 2009 17:50:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37385#M7392</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-05-27T17:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: About  SAS dates conversions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37386#M7393</link>
      <description>You can use the yymmdd8. format for your case.&lt;BR /&gt;
&lt;BR /&gt;
x='20090406';&lt;BR /&gt;
date1=input(x,  yymmdd8.);&lt;BR /&gt;
&lt;BR /&gt;
~ Sukanya E</description>
      <pubDate>Wed, 27 May 2009 23:22:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37386#M7393</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-27T23:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: About  SAS dates conversions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37387#M7394</link>
      <description>I see. Thanks!</description>
      <pubDate>Thu, 28 May 2009 14:27:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37387#M7394</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-28T14:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: About  SAS dates conversions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37388#M7395</link>
      <description>Thanks. In other words, I can convert any numeric to SAS dates?</description>
      <pubDate>Thu, 28 May 2009 14:27:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37388#M7395</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-28T14:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: About  SAS dates conversions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37389#M7396</link>
      <description>Hi:&lt;BR /&gt;
  Sure, you can convert any -NUMBER- to a SAS date or SAS date/time value, as long as that number either&lt;BR /&gt;
1) represents the number of days from Jan 1, 1960 (so the number -3334 represents Nov 15, 1950 and the number 3334 is Feb 16, 1969 and the number 18216 is Nov 15, 2009)&lt;BR /&gt;
 or&lt;BR /&gt;
2) represents the number of seconds from midnight Jan 1, 1960 (date/time value)&lt;BR /&gt;
&lt;BR /&gt;
  However, a NUMERIC variable value like this: 19501115 or a character variable value like this: '19501115' does NOT represent the number of days from Jan 1, 1960 -- so it must be converted from being a number or a character string so that SAS recognizes it as a date variable value and correctly stores your date value as the number of days since Jan 1, 1960.&lt;BR /&gt;
&lt;BR /&gt;
  So when you say "any" numeric, I have to say that the answer is, yes, if you understand SAS date/time values and SAS date/time functions.&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 28 May 2009 15:16:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37389#M7396</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-05-28T15:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: About  SAS dates conversions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37390#M7397</link>
      <description>hehe, i thought that didn't work but that's because my output wasn't formatted. thanks.

Message was edited by: cosmid</description>
      <pubDate>Thu, 28 May 2009 17:36:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37390#M7397</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-28T17:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: About  SAS dates conversions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37391#M7398</link>
      <description>hm..i think i need to read the section SAS dates again. I need to tell whether if the number is a qualified number or a number that I need to convert to characters first. Also, Cynthia, how can you be so good with SAS? I see that you reply pretty much every thread here. How can you know everything about SAS? That's amazing! Any book recommendations? Thanks!</description>
      <pubDate>Thu, 28 May 2009 17:46:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37391#M7398</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-28T17:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: About  SAS dates conversions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37392#M7399</link>
      <description>Hi:&lt;BR /&gt;
  Thanks for the compliment. Long ago, (in a galaxy far, far away) I was a Literature student who discovered that there were no good jobs for someone who could deconstruct Faulkner, Melville, Wallace Stevens and T. S. Eliot. And, so I aimed myself at a programmer trainee job; learned Fortran, Cobol, JCL SAS and Easytreve. &lt;BR /&gt;
                    &lt;BR /&gt;
But SAS was actually the very first programming language I learned, before the programmer trainee job even started. So when I got the opportunity to be a "real" programmer, one of my choices was to work in the Cobol side of the shop or the "ad-hoc" SAS side of the shop. I chose working on the SAS side of things and have been using SAS ever since.&lt;BR /&gt;
        &lt;BR /&gt;
  So it's been a very, -very- long time that I have worked with SAS. I don't know "everything" about SAS -- but I do know how to look things up in the documentation. And, there's the whole puzzle aspect of solving a problem that I find appealing. &lt;BR /&gt;
      &lt;BR /&gt;
My students all speak highly of these authors: Cody, Carpenter, Delwiche/Slaughter, Burlew and Haworth. But there are many other good books available on different topics (For example, I don't teach Stat classes, so I don't know what Stat-related books are most useful.)&lt;BR /&gt;
 &lt;BR /&gt;
The best advice I can give you is learn how to use the resources on support.sas.com -- the search facility, the documentation, the samples and the repository of SAS Global Forum papers. And, don't be afraid to ask yourself "what if" questions and test out your theories or ideas in a test program on sample data.&lt;BR /&gt;
 &lt;BR /&gt;
Good luck!&lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 29 May 2009 01:44:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37392#M7399</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-05-29T01:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: About  SAS dates conversions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37393#M7400</link>
      <description>Thank you for the inputs and advices. I will definitly look into these resources. But I think I should read a few SAS books again just to get a better understanding on everything. I went through both the BASE and ADVANCED SAS certification exam and I feel at the end I remembered and learned nothing. I keep getting stuck on small problems. This just makes me sad. It is like spending so much time and effort and at end you got nothing from it. I have been a SAS programmer for a year and half now and I feel that my skills on SAS did not improve at all. Ok, i need to stop whining and start reading and check on these resources. Thanks again!</description>
      <pubDate>Fri, 29 May 2009 14:40:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37393#M7400</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-29T14:40:49Z</dc:date>
    </item>
    <item>
      <title>Re: About  SAS dates conversions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37394#M7401</link>
      <description>My recommendation - stop reading and start coding!  &lt;BR /&gt;
&lt;BR /&gt;
Then, refer to the SAS documentation and SAS support website resources, as needed, or when you might want to review a particular PROC and/or DATA step programming element.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 29 May 2009 15:23:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37394#M7401</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-05-29T15:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: About  SAS dates conversions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37395#M7402</link>
      <description>i ran through this exercise a little while ago.&lt;BR /&gt;
&lt;BR /&gt;
to import a YYYYMMDD-style integer into a sas date value, i use the ND8601DA. informat and apply the date9. format. YYYYMMDDHHMMSS-style integer into a sas datetime value, one can use the ND8601DT. informat and apply the datetime19. format.&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://quatch.koopmann.us/2009/05/reading-iso-dates-and-datetimes.html" target="_blank"&gt;http://quatch.koopmann.us/2009/05/reading-iso-dates-and-datetimes.html&lt;/A&gt;</description>
      <pubDate>Fri, 29 May 2009 15:43:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37395#M7402</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-29T15:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: About  SAS dates conversions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37396#M7403</link>
      <description>Yes. I think you are right. This is a good place to start. Where I can try to solve other people's questions which will give me practice and help memorize the functions.</description>
      <pubDate>Fri, 29 May 2009 19:06:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37396#M7403</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-29T19:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: About  SAS dates conversions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37397#M7404</link>
      <description>oh, thanks. never heard about this format. will read about it now.</description>
      <pubDate>Fri, 29 May 2009 19:06:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-SAS-dates-conversions/m-p/37397#M7404</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-29T19:06:56Z</dc:date>
    </item>
  </channel>
</rss>

