<?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 separate variable into date and time in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-separate-variable-into-date-and-time/m-p/781597#M249079</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _NULL_;
 a='01JAN2021:03:20:55'dt; put a= datetime22.;
 b=datepart(a)           ; put b= date9.;
 c=timepart(a)           ; put c= time8.;
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
    <pubDate>Sun, 21 Nov 2021 22:44:58 GMT</pubDate>
    <dc:creator>sbxkoenk</dc:creator>
    <dc:date>2021-11-21T22:44:58Z</dc:date>
    <item>
      <title>how to separate variable into date and time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-separate-variable-into-date-and-time/m-p/781593#M249076</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently the variable is formated as datetime22.&amp;nbsp; like 01JAN2021:03:20:55.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I get the time out of this field in the output below ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;03:20:55&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 21 Nov 2021 22:40:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-separate-variable-into-date-and-time/m-p/781593#M249076</guid>
      <dc:creator>EPANG1</dc:creator>
      <dc:date>2021-11-21T22:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to separate variable into date and time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-separate-variable-into-date-and-time/m-p/781595#M249077</link>
      <description>&lt;P&gt;In a data step, assuming your variable is named DATE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;time=timepart(date);
format time time8.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 21 Nov 2021 22:44:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-separate-variable-into-date-and-time/m-p/781595#M249077</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-11-21T22:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to separate variable into date and time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-separate-variable-into-date-and-time/m-p/781597#M249079</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _NULL_;
 a='01JAN2021:03:20:55'dt; put a= datetime22.;
 b=datepart(a)           ; put b= date9.;
 c=timepart(a)           ; put c= time8.;
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sun, 21 Nov 2021 22:44:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-separate-variable-into-date-and-time/m-p/781597#M249079</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-11-21T22:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to separate variable into date and time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-separate-variable-into-date-and-time/m-p/781599#M249081</link>
      <description>Here is the solution. Thanks Koen.&lt;BR /&gt;&lt;BR /&gt;Re: how to separate variable into date and time&lt;BR /&gt;data _NULL_;&lt;BR /&gt;a='01JAN2021:03:20:55'dt; put a= datetime22.;&lt;BR /&gt;b=datepart(a) ; put b= date9.;&lt;BR /&gt;c=timepart(a) ; put c= time8.;&lt;BR /&gt;run;&lt;BR /&gt;/* end of program */&lt;BR /&gt;Koen&lt;BR /&gt;</description>
      <pubDate>Sun, 21 Nov 2021 22:49:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-separate-variable-into-date-and-time/m-p/781599#M249081</guid>
      <dc:creator>EPANG1</dc:creator>
      <dc:date>2021-11-21T22:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to separate variable into date and time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-separate-variable-into-date-and-time/m-p/781601#M249082</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/329652"&gt;@EPANG1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to mark the solution from &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60547"&gt;@sbxkoenk&lt;/a&gt; as correct, not your own post where you repeat his solution.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Nov 2021 22:51:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-separate-variable-into-date-and-time/m-p/781601#M249082</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-11-21T22:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to separate variable into date and time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-separate-variable-into-date-and-time/m-p/781604#M249084</link>
      <description>&lt;P&gt;Especially as it would be my 100th solution.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;No worries!&lt;/P&gt;
&lt;P&gt;I guess&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/329652"&gt;@EPANG1&lt;/a&gt;&amp;nbsp;will do it correct next time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sun, 21 Nov 2021 22:55:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-separate-variable-into-date-and-time/m-p/781604#M249084</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-11-21T22:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to separate variable into date and time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-separate-variable-into-date-and-time/m-p/781605#M249085</link>
      <description>&lt;P&gt;Apologies as I only see your answer in my inbox, but not displaying in the community forum. that's why I have copy the response again.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Nov 2021 22:57:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-separate-variable-into-date-and-time/m-p/781605#M249085</guid>
      <dc:creator>EPANG1</dc:creator>
      <dc:date>2021-11-21T22:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to separate variable into date and time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-separate-variable-into-date-and-time/m-p/781606#M249086</link>
      <description>&lt;P&gt;Again, no worries!&lt;/P&gt;
&lt;P&gt;Maybe you had to refresh / reload the browser page you were looking at (?).&lt;/P&gt;
&lt;P&gt;My answer is definitely in the thread.&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Nov 2021 23:04:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-separate-variable-into-date-and-time/m-p/781606#M249086</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-11-21T23:04:18Z</dc:date>
    </item>
  </channel>
</rss>

