<?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: Referencing a table that has a set of dates in SAS Date format that I want to convert to Date9. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Referencing-a-table-that-has-a-set-of-dates-in-SAS-Date-format/m-p/925866#M364326</link>
    <description>Thank you, that worked. I wasnt aware that was what the function was doing. Appreciate the guidance.</description>
    <pubDate>Thu, 25 Apr 2024 18:51:25 GMT</pubDate>
    <dc:creator>Jyuen204</dc:creator>
    <dc:date>2024-04-25T18:51:25Z</dc:date>
    <item>
      <title>Referencing a table that has a set of dates in SAS Date format that I want to convert to Date9.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Referencing-a-table-that-has-a-set-of-dates-in-SAS-Date-format/m-p/925853#M364319</link>
      <description>&lt;P&gt;I am referencing a table for some data and the table contains a date field but it is set in a SAS Date format:&lt;BR /&gt;23480&lt;BR /&gt;23481&lt;BR /&gt;23482 etc&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to query the data and pull it with Date9 format&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried :&lt;BR /&gt;SELECT DATEPART(RT_DATE) AS PERIOD_DT format = date9.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but it returns with the base SAS date (Jan 1 1960)&lt;BR /&gt;&lt;BR /&gt;Is there another method to use in my select to get the date to convert? Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 18:03:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Referencing-a-table-that-has-a-set-of-dates-in-SAS-Date-format/m-p/925853#M364319</guid>
      <dc:creator>Jyuen204</dc:creator>
      <dc:date>2024-04-25T18:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Referencing a table that has a set of dates in SAS Date format that I want to convert to Date9.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Referencing-a-table-that-has-a-set-of-dates-in-SAS-Date-format/m-p/925857#M364320</link>
      <description>&lt;P&gt;If the values are integers, like 23480, you just assign the DATE9. format to this variable.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 18:20:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Referencing-a-table-that-has-a-set-of-dates-in-SAS-Date-format/m-p/925857#M364320</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-04-25T18:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: Referencing a table that has a set of dates in SAS Date format that I want to convert to Date9.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Referencing-a-table-that-has-a-set-of-dates-in-SAS-Date-format/m-p/925862#M364323</link>
      <description>&lt;P&gt;Why did you treat the values as if they were DATETIME values instead of DATE values?&lt;/P&gt;
&lt;P&gt;SAS stores datetime values in seconds and date values in days.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The number&amp;nbsp;&lt;SPAN&gt;23,480 is&amp;nbsp; 01JAN1960:06:31:20 when treated as a count of seconds but it is&amp;nbsp;14APR2024 when treated as a count of days.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 18:41:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Referencing-a-table-that-has-a-set-of-dates-in-SAS-Date-format/m-p/925862#M364323</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-04-25T18:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Referencing a table that has a set of dates in SAS Date format that I want to convert to Date9.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Referencing-a-table-that-has-a-set-of-dates-in-SAS-Date-format/m-p/925863#M364324</link>
      <description>I was not aware that I did. I am simply looking for a select option to get a date9. date from a source table that has the date values in SAS format</description>
      <pubDate>Thu, 25 Apr 2024 18:45:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Referencing-a-table-that-has-a-set-of-dates-in-SAS-Date-format/m-p/925863#M364324</guid>
      <dc:creator>Jyuen204</dc:creator>
      <dc:date>2024-04-25T18:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Referencing a table that has a set of dates in SAS Date format that I want to convert to Date9.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Referencing-a-table-that-has-a-set-of-dates-in-SAS-Date-format/m-p/925864#M364325</link>
      <description>&lt;P&gt;The DATEPART function assumes that you are extracting a Date value from a DATETIME value. DATETIME values are numbers of seconds and dates are numbers of days. So when you apply the Datepart to a date you get a very much smaller result. Basically any date between 01JAN1960 and 20JUL2196 will return a "datepart" value of 01JAN1960.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your numeric value of 23480 is 14APR2024. So applying datepart to it will result in 01JAN1960.&lt;/P&gt;
&lt;P&gt;So you apparently have date values and using Datepart is not wanted or needed. Just apply the date9. format to that variable.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 19:03:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Referencing-a-table-that-has-a-set-of-dates-in-SAS-Date-format/m-p/925864#M364325</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-04-25T19:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Referencing a table that has a set of dates in SAS Date format that I want to convert to Date9.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Referencing-a-table-that-has-a-set-of-dates-in-SAS-Date-format/m-p/925866#M364326</link>
      <description>Thank you, that worked. I wasnt aware that was what the function was doing. Appreciate the guidance.</description>
      <pubDate>Thu, 25 Apr 2024 18:51:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Referencing-a-table-that-has-a-set-of-dates-in-SAS-Date-format/m-p/925866#M364326</guid>
      <dc:creator>Jyuen204</dc:creator>
      <dc:date>2024-04-25T18:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Referencing a table that has a set of dates in SAS Date format that I want to convert to Date9.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Referencing-a-table-that-has-a-set-of-dates-in-SAS-Date-format/m-p/925868#M364327</link>
      <description>&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Working-with-Dates-and-Times-in-SAS-Tutorial/ta-p/424354" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Working-with-Dates-and-Times-in-SAS-Tutorial/ta-p/424354&lt;/A&gt; has a PDF with much information about dates you may find helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 19:04:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Referencing-a-table-that-has-a-set-of-dates-in-SAS-Date-format/m-p/925868#M364327</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-04-25T19:04:06Z</dc:date>
    </item>
  </channel>
</rss>

