<?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: datetime and date formatting issue in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/datetime-and-date-in-same-column/m-p/503241#M793</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/225082"&gt;@user112a2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;This worked!!!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data OUT.REQ_1_3_02 ;
SET OUT.REQ_1_3_01;

&lt;FONT color="#FF0000"&gt;a= day(PST_DT);
b= month(PST_DT);
 c= year(PST_DT);
 date = input(catx("/",b,a,c),mmddyy10.);&lt;/FONT&gt;
 format date mmddyy10.;
run ;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Under normal circumstances, if PST_DT contains valid SAS date values or ordinary missing values, the four highlighted lines above could be simplified to:&lt;/P&gt;
&lt;PRE&gt;date=PST_DT;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Oct 2018 21:07:51 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2018-10-10T21:07:51Z</dc:date>
    <item>
      <title>datetime and date in same column</title>
      <link>https://communities.sas.com/t5/New-SAS-User/datetime-and-date-in-same-column/m-p/503079#M763</link>
      <description>&lt;P&gt;I have a question. I have a field in my SAS dataset that has a mixture of datetime and date variables.&lt;BR /&gt;The field is PST_DT and is Type: Numeric. Group: Date. Format: Date9. Length: 8.&lt;BR /&gt;Some values look like this:&lt;/P&gt;&lt;PRE&gt;Removed&lt;/PRE&gt;&lt;P&gt;How can I turn just the datetime values in date format? I want all the values to be in date format.&lt;BR /&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 15:45:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/datetime-and-date-in-same-column/m-p/503079#M763</guid>
      <dc:creator>user112a2</dc:creator>
      <dc:date>2019-04-26T15:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: datetime and date formatting issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/datetime-and-date-in-same-column/m-p/503080#M764</link>
      <description>&lt;P&gt;This does not look like a date9 formatted variable. Can you show a PROC CONTENTS output?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 13:37:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/datetime-and-date-in-same-column/m-p/503080#M764</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-10-10T13:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: datetime and date formatting issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/datetime-and-date-in-same-column/m-p/503085#M766</link>
      <description>&lt;P&gt;Removed&lt;/P&gt;</description>
      <pubDate>Fri, 26 Apr 2019 17:46:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/datetime-and-date-in-same-column/m-p/503085#M766</guid>
      <dc:creator>user112a2</dc:creator>
      <dc:date>2019-04-26T17:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: datetime and date formatting issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/datetime-and-date-in-same-column/m-p/503086#M767</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/225082"&gt;@user112a2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a question. I have a field in my SAS dataset that has a mixture of datetime and date variables.&lt;BR /&gt;The field is PST_DT and is Type: Numeric. Group: Date. Format: Date9. Length: 8.&lt;BR /&gt;Some values look like this:&lt;/P&gt;
&lt;PRE&gt;PST_DT
8/22/2018  11:59:59 PM
8/22/2018&lt;/PRE&gt;
&lt;P&gt;How can I turn just the datetime values in date format? I want all the values to be in date format.&lt;BR /&gt;Thanks.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There's nothing at all that looks like a date9 formatted value.&lt;/P&gt;
&lt;P&gt;Is your example actually a part of a text file you want to read into a SAS dataset?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 13:47:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/datetime-and-date-in-same-column/m-p/503086#M767</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-10T13:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: datetime and date formatting issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/datetime-and-date-in-same-column/m-p/503087#M768</link>
      <description>&lt;P&gt;Then your original example CAN NOT be from this dataset. Your date values would both(!) display as 22AUG2018, without ANY time value.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/225082"&gt;@user112a2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG"&gt;&lt;img src="https://communities.sas.com/skins/images/70F8802BAA6255D55FBEC62A8226FB10/responsive_peak/images/image_not_found.png" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 13:49:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/datetime-and-date-in-same-column/m-p/503087#M768</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-10T13:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: datetime and date formatting issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/datetime-and-date-in-same-column/m-p/503088#M769</link>
      <description>&lt;P&gt;These values were imported from an excel file into SAS. Some of the values had dates and some had datetime values. These were imported into a SAS data set.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 13:51:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/datetime-and-date-in-same-column/m-p/503088#M769</guid>
      <dc:creator>user112a2</dc:creator>
      <dc:date>2018-10-10T13:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: datetime and date formatting issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/datetime-and-date-in-same-column/m-p/503089#M770</link>
      <description>&lt;P&gt;Then please post the values &lt;EM&gt;as they are in the dataset.&lt;/EM&gt; A date9. formatted variable can NEVER look like 8/22/2018. NEVER.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 13:52:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/datetime-and-date-in-same-column/m-p/503089#M770</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-10T13:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: datetime and date formatting issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/datetime-and-date-in-same-column/m-p/503097#M772</link>
      <description>&lt;P&gt;This worked!!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Removed&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Apr 2019 17:46:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/datetime-and-date-in-same-column/m-p/503097#M772</guid>
      <dc:creator>user112a2</dc:creator>
      <dc:date>2019-04-26T17:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: datetime and date formatting issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/datetime-and-date-in-same-column/m-p/503241#M793</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/225082"&gt;@user112a2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;This worked!!!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data OUT.REQ_1_3_02 ;
SET OUT.REQ_1_3_01;

&lt;FONT color="#FF0000"&gt;a= day(PST_DT);
b= month(PST_DT);
 c= year(PST_DT);
 date = input(catx("/",b,a,c),mmddyy10.);&lt;/FONT&gt;
 format date mmddyy10.;
run ;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Under normal circumstances, if PST_DT contains valid SAS date values or ordinary missing values, the four highlighted lines above could be simplified to:&lt;/P&gt;
&lt;PRE&gt;date=PST_DT;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 21:07:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/datetime-and-date-in-same-column/m-p/503241#M793</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-10T21:07:51Z</dc:date>
    </item>
  </channel>
</rss>

