<?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 do I transform one varible with DATETIME16. format in 2 disctincts time and date variables in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-transform-one-varible-with-DATETIME16-format-in-2/m-p/555683#M17020</link>
    <description>&lt;P&gt;SAS has functions that accomplish this simply:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  time_created= timepart(creation_date);
  date_created = datepart(creation_date);
  format date_created ddmmyys10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You might also select a format for the TIME_CREATED variable.&amp;nbsp; You have choices to make here, so this is a good place to start:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=leforinforref&amp;amp;docsetTarget=p0b2xn5ovzhtjnn1db5g1gg64yhf.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=leforinforref&amp;amp;docsetTarget=p0b2xn5ovzhtjnn1db5g1gg64yhf.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 02 May 2019 17:42:43 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2019-05-02T17:42:43Z</dc:date>
    <item>
      <title>How do I transform one varible with DATETIME16. format in 2 disctincts time and date variables</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-transform-one-varible-with-DATETIME16-format-in-2/m-p/555677#M17019</link>
      <description>&lt;P&gt;Dear Group,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to work with a big dataset (&amp;gt;1 million lines) file where I have dateandtime data combined in&amp;nbsp;DATETIME16. format.&amp;nbsp;&lt;/P&gt;&lt;P&gt;These datetime are corresponding to a variable named Creation_date. I am not used with that format.&lt;/P&gt;&lt;P&gt;I want to split the variable Creation_date.in date_created and time_created (the 1st variable would be the date dd/mm/yyyy and the second would be the time).&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've found some way to do it after manually importing the data using CARDS but this is not feasible with a large dataset.&lt;/P&gt;&lt;P&gt;thank so much!&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 17:32:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-transform-one-varible-with-DATETIME16-format-in-2/m-p/555677#M17019</guid>
      <dc:creator>SBuc</dc:creator>
      <dc:date>2019-05-02T17:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I transform one varible with DATETIME16. format in 2 disctincts time and date variables</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-transform-one-varible-with-DATETIME16-format-in-2/m-p/555683#M17020</link>
      <description>&lt;P&gt;SAS has functions that accomplish this simply:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  time_created= timepart(creation_date);
  date_created = datepart(creation_date);
  format date_created ddmmyys10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You might also select a format for the TIME_CREATED variable.&amp;nbsp; You have choices to make here, so this is a good place to start:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=leforinforref&amp;amp;docsetTarget=p0b2xn5ovzhtjnn1db5g1gg64yhf.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=leforinforref&amp;amp;docsetTarget=p0b2xn5ovzhtjnn1db5g1gg64yhf.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 17:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-transform-one-varible-with-DATETIME16-format-in-2/m-p/555683#M17020</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-05-02T17:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I transform one varible with DATETIME16. format in 2 disctincts time and date variables</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-transform-one-varible-with-DATETIME16-format-in-2/m-p/555687#M17022</link>
      <description>&lt;P&gt;It's not clear from your post if your variable is a character variable that looks like DATETIME16., or if it's already a SAS datetime variable that has a DATETIME16. format applied.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it's the former, you can use the INPUT function to transform it to a SAS datetime variable, something like the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;GoodVar = input(BadVar, anydtdtm16.);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you have it as a datetime variable, there are a number of options. Easiest is to leave it as a datetime variable, but just use formats to display the date and time. Alternately, the DATEPART and TIMEPART functions will divide the datetime variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 17:44:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-transform-one-varible-with-DATETIME16-format-in-2/m-p/555687#M17022</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2019-05-02T17:44:06Z</dc:date>
    </item>
  </channel>
</rss>

