<?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 a formatted SAS date back to a SAS numeric date? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-convert-a-formatted-SAS-date-back-to-a-SAS-numeric-date/m-p/851091#M37311</link>
    <description>Hi SASKiwi,&lt;BR /&gt;&lt;BR /&gt;I actually wanted the opposite result, 29JUN2017 displayed as 20999. But now I know to do that is just to remove the formats. Thanks for the help though.&lt;BR /&gt;&lt;BR /&gt;Merry Christmas!</description>
    <pubDate>Sun, 25 Dec 2022 22:09:51 GMT</pubDate>
    <dc:creator>cosmid</dc:creator>
    <dc:date>2022-12-25T22:09:51Z</dc:date>
    <item>
      <title>How to convert a formatted SAS date back to a SAS numeric date?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-convert-a-formatted-SAS-date-back-to-a-SAS-numeric-date/m-p/851080#M37306</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS can store date as a SAS numeric date like 20999. There are a lot of functions to format this value to a readable value like a MM/DD/YYYY format.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is, how do you convert a formatted SAS date back to a SAS numeric date?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 25 Dec 2022 21:28:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-convert-a-formatted-SAS-date-back-to-a-SAS-numeric-date/m-p/851080#M37306</guid>
      <dc:creator>cosmid</dc:creator>
      <dc:date>2022-12-25T21:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a formatted SAS date back to a SAS numeric date?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-convert-a-formatted-SAS-date-back-to-a-SAS-numeric-date/m-p/851083#M37308</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A format is NOT a function.&lt;BR /&gt;It is just a part of the metadata for a variable that tells SAS how to display the internal value.&lt;/P&gt;
&lt;P&gt;With or without format , the internal numeric value stays always the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To remove the format (such that internal value is shown as a number for your date-var) , do this :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc datasets lib=mylib memtype=data;
   modify TableABC;
     attrib DateVarXYZ format=;
contents data=mylib.TableABC;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Cheers,&lt;BR /&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sun, 25 Dec 2022 21:53:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-convert-a-formatted-SAS-date-back-to-a-SAS-numeric-date/m-p/851083#M37308</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2022-12-25T21:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a formatted SAS date back to a SAS numeric date?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-convert-a-formatted-SAS-date-back-to-a-SAS-numeric-date/m-p/851084#M37309</link>
      <description>&lt;P&gt;SAS dates are numeric only and can optionally have a format applied:&lt;/P&gt;
&lt;PRE&gt;28         data _null_;
29           SASDate = 20999;
30           format SASDate date9.;
31           put _all_;
32         run;

SASDate=29JUN2017 _ERROR_=0 _N_=1
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds&lt;/PRE&gt;</description>
      <pubDate>Sun, 25 Dec 2022 21:56:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-convert-a-formatted-SAS-date-back-to-a-SAS-numeric-date/m-p/851084#M37309</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-12-25T21:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a formatted SAS date back to a SAS numeric date?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-convert-a-formatted-SAS-date-back-to-a-SAS-numeric-date/m-p/851088#M37310</link>
      <description>Thanks for the quick reply! I wasn't expecting any replies on Christmas day!&lt;BR /&gt;&lt;BR /&gt;I really appreciate the info. Now I know dates in SAS are always SAS numeric values (a number) and can be used in arithmetics (even if they are formatted). The formats and informats are just there for how they are displayed and stored.&lt;BR /&gt;&lt;BR /&gt;Thanks again for the help and Merry Christmas!</description>
      <pubDate>Sun, 25 Dec 2022 22:08:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-convert-a-formatted-SAS-date-back-to-a-SAS-numeric-date/m-p/851088#M37310</guid>
      <dc:creator>cosmid</dc:creator>
      <dc:date>2022-12-25T22:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a formatted SAS date back to a SAS numeric date?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-convert-a-formatted-SAS-date-back-to-a-SAS-numeric-date/m-p/851091#M37311</link>
      <description>Hi SASKiwi,&lt;BR /&gt;&lt;BR /&gt;I actually wanted the opposite result, 29JUN2017 displayed as 20999. But now I know to do that is just to remove the formats. Thanks for the help though.&lt;BR /&gt;&lt;BR /&gt;Merry Christmas!</description>
      <pubDate>Sun, 25 Dec 2022 22:09:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-convert-a-formatted-SAS-date-back-to-a-SAS-numeric-date/m-p/851091#M37311</guid>
      <dc:creator>cosmid</dc:creator>
      <dc:date>2022-12-25T22:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a formatted SAS date back to a SAS numeric date?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-convert-a-formatted-SAS-date-back-to-a-SAS-numeric-date/m-p/851134#M37325</link>
      <description>&lt;P&gt;Hello ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am glad you got it.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In SAS V9.4 , there are only 2 data types : character &amp;amp; numeric (dates are just formatted numeric values).&lt;/P&gt;
&lt;P&gt;( In SAS VIYA , there are many more data types ... for CAS-tables ).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This sentence of yours might be a bit confusing :&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The formats and informats are just there for how they are displayed and stored.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I would rather say :&lt;BR /&gt;The formats are just there for how they (the numbers) are displayed.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The informats are just there for how they are read and stored (as a number).&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Koen&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2022 12:07:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-convert-a-formatted-SAS-date-back-to-a-SAS-numeric-date/m-p/851134#M37325</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2022-12-26T12:07:41Z</dc:date>
    </item>
  </channel>
</rss>

