<?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: how to convert numeric values to numeric dates? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-numeric-values-to-numeric-dates/m-p/707333#M217164</link>
    <description>&lt;P&gt;Use the DATEPART function as documented here:&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p0rttbu7w62xgzn1damccyuwpld8.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;DATEPART&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  RFSTDT = '16DEC2020:00:00:00.000'dt;
  NEW_RFSTDT = datepart(RFSTDT);
  format RFSTDT datetime22.3 NEW_RFSTDT yymmddd10.;
  put _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You also asked the same question here:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Programming/convert-numeric-date-to-another-format/td-p/707137" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/convert-numeric-date-to-another-format/td-p/707137&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;and you got the same answer. Why the repeat?&lt;/P&gt;</description>
    <pubDate>Mon, 21 Dec 2020 05:52:01 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2020-12-21T05:52:01Z</dc:date>
    <item>
      <title>how to convert numeric values to numeric dates?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-numeric-values-to-numeric-dates/m-p/707331#M217163</link>
      <description>&lt;P&gt;I have a numeric date with time and I need to convert just the datepart into yyyy-mm-dd format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data (numeric):&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;RFSTDT
16DEC2020:00:00:00.000&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;want (numeric):&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NEW_RFSTDT
2020-12-16&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2020 01:54:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-numeric-values-to-numeric-dates/m-p/707331#M217163</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2020-12-21T01:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert numeric values to numeric dates?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-numeric-values-to-numeric-dates/m-p/707333#M217164</link>
      <description>&lt;P&gt;Use the DATEPART function as documented here:&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p0rttbu7w62xgzn1damccyuwpld8.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;DATEPART&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  RFSTDT = '16DEC2020:00:00:00.000'dt;
  NEW_RFSTDT = datepart(RFSTDT);
  format RFSTDT datetime22.3 NEW_RFSTDT yymmddd10.;
  put _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You also asked the same question here:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Programming/convert-numeric-date-to-another-format/td-p/707137" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/convert-numeric-date-to-another-format/td-p/707137&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;and you got the same answer. Why the repeat?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2020 05:52:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-numeric-values-to-numeric-dates/m-p/707333#M217164</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-12-21T05:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert numeric values to numeric dates?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-numeric-values-to-numeric-dates/m-p/707334#M217165</link>
      <description>&lt;P&gt;As you hinted, you need to use the &lt;FONT face="courier new,courier"&gt;datepart()&lt;/FONT&gt; function to convert a SAS datetime to a SAS date.&lt;/P&gt;
&lt;P&gt;To display that date as you want, use the &lt;FONT face="courier new,courier"&gt;yymmddd10.&lt;/FONT&gt; format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2020 02:25:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-numeric-values-to-numeric-dates/m-p/707334#M217165</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-12-21T02:25:29Z</dc:date>
    </item>
  </channel>
</rss>

