<?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: Remove time from dates in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Remove-time-from-dates/m-p/945763#M42477</link>
    <description>&lt;P&gt;You won... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Oct 2024 09:33:58 GMT</pubDate>
    <dc:creator>NewUsrStat</dc:creator>
    <dc:date>2024-10-01T09:33:58Z</dc:date>
    <item>
      <title>Remove time from dates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-time-from-dates/m-p/945761#M42475</link>
      <description>&lt;P&gt;Hi guys,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to remove time from dates.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The situation is the following:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NewUsrStat_0-1727770428946.png" style="width: 204px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/100774iB4683B1717E77E61/image-dimensions/204x167?v=v2" width="204" height="167" role="button" title="NewUsrStat_0-1727770428946.png" alt="NewUsrStat_0-1727770428946.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I tried to use the following code:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data my_data_corrected;
	set my_data;
	Date_Value = input(date, anydtdte.);
        Date_Only = datepart(Date_Value);
        format Date_Only date9.; 
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Unfortunately it seems not to work I suppose because of the presence of blanks.&lt;/P&gt;
&lt;P&gt;Could it be the case?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After running the code dates are converted as follows:&amp;nbsp;31DEC1959.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone help me please?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: the variable "date" is stored as Num, DATETIME20.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 08:19:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-time-from-dates/m-p/945761#M42475</guid>
      <dc:creator>NewUsrStat</dc:creator>
      <dc:date>2024-10-01T08:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Remove time from dates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-time-from-dates/m-p/945762#M42476</link>
      <description>&lt;P&gt;If the variable "date" is originally stored with the datetime format then it is numeric.&lt;/P&gt;
&lt;P&gt;Use&lt;/P&gt;
&lt;PRE&gt;data my_data_corrected;
	set my_data;
	Date_only= datepart(date);
        format Date_Only date9.; 
run;
&lt;/PRE&gt;
&lt;P&gt;The bit that date has a datetime format means it is a numeric value and use of "input" is not needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best on this forum is to include the LOG from running the code. Copy the code with all the notes and messages from the log. Then paste that into a text box. I will place a small wager that your log shows a "numeric values were converted to character" somewhere.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 08:26:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-time-from-dates/m-p/945762#M42476</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-10-01T08:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: Remove time from dates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-time-from-dates/m-p/945763#M42477</link>
      <description>&lt;P&gt;You won... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 09:33:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-time-from-dates/m-p/945763#M42477</guid>
      <dc:creator>NewUsrStat</dc:creator>
      <dc:date>2024-10-01T09:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: Remove time from dates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-time-from-dates/m-p/945769#M42478</link>
      <description>&lt;P&gt;There's a reason why Maxim 2 is so far up on the list. Always post the log when a step does not work as expected. The log is our #1 diagnostic tool.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 11:01:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-time-from-dates/m-p/945769#M42478</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-10-01T11:01:37Z</dc:date>
    </item>
  </channel>
</rss>

