<?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 convert character format 2016-03-15 12:05:29.222699 to a date format ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-character-format-2016-03-15-12-05-29-222699-to-a/m-p/299531#M63195</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Be careful using a decimal setting on an INFORMAT. That means that when in the input text doesn't have a period then imply a period. Probably not going to be a problem with time data, but could cause real confusion and wrong results when reading values that could be integers.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yep. e8601dt26. (without the decimals) works just the same, the fractional part is still read correctly.&lt;/P&gt;
&lt;P&gt;I'm just so used to clean input data (all our timestamps come from DB/2 unloads) that I don't notice such things.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Sep 2016 13:18:56 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2016-09-20T13:18:56Z</dc:date>
    <item>
      <title>How to convert character format 2016-03-15 12:05:29.222699 to a date format ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-character-format-2016-03-15-12-05-29-222699-to-a/m-p/299346#M63094</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following values for date in character/string format and I wish to convert to date (datetime22.3) but no method seems to work.&lt;/P&gt;&lt;P&gt;A solution in PROC SQL would be ideal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2016-03-15 12:05:29.222699&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2016 18:09:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-character-format-2016-03-15-12-05-29-222699-to-a/m-p/299346#M63094</guid>
      <dc:creator>camfarrell25</dc:creator>
      <dc:date>2016-09-19T18:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert character format 2016-03-15 12:05:29.222699 to a date format ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-character-format-2016-03-15-12-05-29-222699-to-a/m-p/299348#M63095</link>
      <description>&lt;P&gt;The INFORMAT of anydtdte26. seems to do the trick.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;795   data want ;
796     input @1 anydt anydtdtm26. @1 date yymmdd10. time time17.;
797     format anydt datetime. date date. time time.;
798     put (_all_) (=);
799   cards;

anydt=15MAR16:12:05:29 date=15MAR16 time=12:05:29
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2016 17:56:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-character-format-2016-03-15-12-05-29-222699-to-a/m-p/299348#M63095</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-09-19T17:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert character format 2016-03-15 12:05:29.222699 to a date format ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-character-format-2016-03-15-12-05-29-222699-to-a/m-p/299518#M63190</link>
      <description>&lt;P&gt;You might also consider using the e8601dt informat for this conversion:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
x1 = "2016-03-15 12:05:29.222699";
x2 = input(x1,e8601dt26.6);
format x2 datetime22.3;
run;

proc print noobs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;            x1                                    x2

2016-03-15 12:05:29.222699    15MAR2016:12:05:29.223
&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Sep 2016 11:55:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-character-format-2016-03-15-12-05-29-222699-to-a/m-p/299518#M63190</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-09-20T11:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert character format 2016-03-15 12:05:29.222699 to a date format ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-character-format-2016-03-15-12-05-29-222699-to-a/m-p/299526#M63194</link>
      <description>&lt;P&gt;Be careful using a decimal setting on an INFORMAT. That means that when in the input text doesn't have a period then imply a period. Probably not going to be a problem with time data, but could cause real confusion and wrong results when reading values that could be integers.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2016 12:54:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-character-format-2016-03-15-12-05-29-222699-to-a/m-p/299526#M63194</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-09-20T12:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert character format 2016-03-15 12:05:29.222699 to a date format ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-character-format-2016-03-15-12-05-29-222699-to-a/m-p/299531#M63195</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Be careful using a decimal setting on an INFORMAT. That means that when in the input text doesn't have a period then imply a period. Probably not going to be a problem with time data, but could cause real confusion and wrong results when reading values that could be integers.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yep. e8601dt26. (without the decimals) works just the same, the fractional part is still read correctly.&lt;/P&gt;
&lt;P&gt;I'm just so used to clean input data (all our timestamps come from DB/2 unloads) that I don't notice such things.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2016 13:18:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-character-format-2016-03-15-12-05-29-222699-to-a/m-p/299531#M63195</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-09-20T13:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert character format 2016-03-15 12:05:29.222699 to a date format ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-character-format-2016-03-15-12-05-29-222699-to-a/m-p/299541#M63196</link>
      <description>&lt;P&gt;Trouble is that FORMAT and INFORMAT specifcations look similar, but the meaning of adding the decimal part to an INFORMAT is totally different than the meaing of adding it to a FORMAT. &amp;nbsp;It is just best to get in the habit of&amp;nbsp;NOT&amp;nbsp;adding a decimal part to an INFORMAT unless you specifically did not write&amp;nbsp;the period when writting the text version of the data and you want SAS to divide those values by 10**D.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2016 14:00:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-character-format-2016-03-15-12-05-29-222699-to-a/m-p/299541#M63196</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-09-20T14:00:12Z</dc:date>
    </item>
  </channel>
</rss>

