<?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: Breaking out a date from a date/time variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Breaking-out-a-date-from-a-date-time-variable/m-p/775882#M246657</link>
    <description>&lt;P&gt;Use the DATEPART function. In a DATA step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;date_only=datepart(rpt_date);
format date_only mmddyy.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;What I need to do is convert this so that it reads as 03/11/2020.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Adding, this is often a poor choice to format dates, as the above date can be interpreted as March 11 or November 3. So I recommend you avoid using this format if at all possible.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Oct 2021 14:41:27 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-10-22T14:41:27Z</dc:date>
    <item>
      <title>Breaking out a date from a date/time variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Breaking-out-a-date-from-a-date-time-variable/m-p/775880#M246656</link>
      <description>&lt;P&gt;I've been fighting with this one and it's time to just ask for help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried other solutions from the community forums but they didn't work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So let's call the variable RPT_DATE.&amp;nbsp; The data I received is formatted like: 3/11/2020 9:01:54 AM&lt;/P&gt;&lt;P&gt;When I import this it appears as 11MAR20:09:01:54&amp;nbsp; Format as DATETIME. Informat ANYDTDTM40.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I need to do is convert this so that it reads as 03/11/2020.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sorry, I am sure this is simple but I have struck out at this point.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 14:32:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Breaking-out-a-date-from-a-date-time-variable/m-p/775880#M246656</guid>
      <dc:creator>DanielQuay</dc:creator>
      <dc:date>2021-10-22T14:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: Breaking out a date from a date/time variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Breaking-out-a-date-from-a-date-time-variable/m-p/775882#M246657</link>
      <description>&lt;P&gt;Use the DATEPART function. In a DATA step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;date_only=datepart(rpt_date);
format date_only mmddyy.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;What I need to do is convert this so that it reads as 03/11/2020.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Adding, this is often a poor choice to format dates, as the above date can be interpreted as March 11 or November 3. So I recommend you avoid using this format if at all possible.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 14:41:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Breaking-out-a-date-from-a-date-time-variable/m-p/775882#M246657</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-10-22T14:41:27Z</dc:date>
    </item>
  </channel>
</rss>

