<?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 Reformating of Date (DDMMMYYYY HH:MM:SS) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reformating-of-Date-DDMMMYYYY-HH-MM-SS/m-p/647113#M193624</link>
    <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I currently have the date (varname: serv_date) presented in the format of&amp;nbsp; (DDMMMYYYY HH:MM:SS). Currently, I'm trying to reformat it so that the table would only contain ddmmmyyyy.&lt;BR /&gt;&lt;BR /&gt;I've tried some solutions such as ...&lt;/P&gt;&lt;PRE&gt;proc sql; 
create table test as 
select serv_date format = date9.
from plastics_fnl; 
quit;&lt;/PRE&gt;&lt;P&gt;But the output is quite odd and unexpected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Date issues.PNG" style="width: 141px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39336i4983F82DA676244D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Date issues.PNG" alt="Date issues.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May someone help identify a solution as well as explain what went wrong in the code I provided?&lt;/P&gt;</description>
    <pubDate>Tue, 12 May 2020 14:53:34 GMT</pubDate>
    <dc:creator>deengyn</dc:creator>
    <dc:date>2020-05-12T14:53:34Z</dc:date>
    <item>
      <title>Reformating of Date (DDMMMYYYY HH:MM:SS)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reformating-of-Date-DDMMMYYYY-HH-MM-SS/m-p/647113#M193624</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I currently have the date (varname: serv_date) presented in the format of&amp;nbsp; (DDMMMYYYY HH:MM:SS). Currently, I'm trying to reformat it so that the table would only contain ddmmmyyyy.&lt;BR /&gt;&lt;BR /&gt;I've tried some solutions such as ...&lt;/P&gt;&lt;PRE&gt;proc sql; 
create table test as 
select serv_date format = date9.
from plastics_fnl; 
quit;&lt;/PRE&gt;&lt;P&gt;But the output is quite odd and unexpected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Date issues.PNG" style="width: 141px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/39336i4983F82DA676244D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Date issues.PNG" alt="Date issues.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May someone help identify a solution as well as explain what went wrong in the code I provided?&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 14:53:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reformating-of-Date-DDMMMYYYY-HH-MM-SS/m-p/647113#M193624</guid>
      <dc:creator>deengyn</dc:creator>
      <dc:date>2020-05-12T14:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Reformating of Date (DDMMMYYYY HH:MM:SS)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reformating-of-Date-DDMMMYYYY-HH-MM-SS/m-p/647116#M193625</link>
      <description>&lt;P&gt;How about&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql; 
create table test as 
select datepart(serv_date) as serv_date format = date9.
from plastics_fnl; 
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 May 2020 14:57:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reformating-of-Date-DDMMMYYYY-HH-MM-SS/m-p/647116#M193625</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-05-12T14:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Reformating of Date (DDMMMYYYY HH:MM:SS)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reformating-of-Date-DDMMMYYYY-HH-MM-SS/m-p/647118#M193627</link>
      <description>&lt;P&gt;If a value is a SAS datetime value then the units are SECONDS, if a date then the units are DAYS. So you cannot use a date9 format to display datetime. If you assign a datetime9. format then that will appear similar to a date9 format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OR use the datepart(dtvariable) function to create date value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 15:00:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reformating-of-Date-DDMMMYYYY-HH-MM-SS/m-p/647118#M193627</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-12T15:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: Reformating of Date (DDMMMYYYY HH:MM:SS)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reformating-of-Date-DDMMMYYYY-HH-MM-SS/m-p/647120#M193628</link>
      <description>Amazing! Thank you for the quick response and help!</description>
      <pubDate>Tue, 12 May 2020 15:07:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reformating-of-Date-DDMMMYYYY-HH-MM-SS/m-p/647120#M193628</guid>
      <dc:creator>deengyn</dc:creator>
      <dc:date>2020-05-12T15:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Reformating of Date (DDMMMYYYY HH:MM:SS)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reformating-of-Date-DDMMMYYYY-HH-MM-SS/m-p/647121#M193629</link>
      <description>&lt;P&gt;You don't need to create a new date variable. All you need to do is assign the DTDATE format.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=leforinforref&amp;amp;docsetTarget=n1wi7cnt9ozjwan1gl0397h6b0n1.htm&amp;amp;locale=en"&gt;https://documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=leforinforref&amp;amp;docsetTarget=n1wi7cnt9ozjwan1gl0397h6b0n1.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 15:07:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reformating-of-Date-DDMMMYYYY-HH-MM-SS/m-p/647121#M193629</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-05-12T15:07:36Z</dc:date>
    </item>
  </channel>
</rss>

