<?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: Converting Character date with time in to numeric with leangth of 8 in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-Character-date-with-time-in-to-numeric-with-leangth/m-p/565754#M33966</link>
    <description>&lt;P&gt;the same format I need , but the type should be numeric&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jun 2019 06:32:28 GMT</pubDate>
    <dc:creator>ambadi007</dc:creator>
    <dc:date>2019-06-13T06:32:28Z</dc:date>
    <item>
      <title>Converting Character date with time in to numeric with leangth of 8</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-Character-date-with-time-in-to-numeric-with-leangth/m-p/565752#M33964</link>
      <description>&lt;P&gt;Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to convert the dates like below to a numeric with the length of 8 , but its not converting right.&lt;/P&gt;&lt;P&gt;value-2019-07-25T 15:35&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 06:26:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-Character-date-with-time-in-to-numeric-with-leangth/m-p/565752#M33964</guid>
      <dc:creator>ambadi007</dc:creator>
      <dc:date>2019-06-13T06:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Character date with time in to numeric with leangth of 8</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-Character-date-with-time-in-to-numeric-with-leangth/m-p/565753#M33965</link>
      <description>&lt;P&gt;Do you want to convert it to a date or datetime value?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 06:29:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-Character-date-with-time-in-to-numeric-with-leangth/m-p/565753#M33965</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-06-13T06:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Character date with time in to numeric with leangth of 8</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-Character-date-with-time-in-to-numeric-with-leangth/m-p/565754#M33966</link>
      <description>&lt;P&gt;the same format I need , but the type should be numeric&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 06:32:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-Character-date-with-time-in-to-numeric-with-leangth/m-p/565754#M33966</guid>
      <dc:creator>ambadi007</dc:creator>
      <dc:date>2019-06-13T06:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Character date with time in to numeric with leangth of 8</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-Character-date-with-time-in-to-numeric-with-leangth/m-p/565756#M33967</link>
      <description>&lt;P&gt;you can convert it to a numeric datetime value like this. Then format to your liking&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
    chardt="2019-07-25T 15:35";
    dt=input(chardt, B8601DT.);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Jun 2019 06:52:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-Character-date-with-time-in-to-numeric-with-leangth/m-p/565756#M33967</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-06-13T06:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Character date with time in to numeric with leangth of 8</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-Character-date-with-time-in-to-numeric-with-leangth/m-p/565757#M33968</link>
      <description>&lt;P&gt;Since your datetime looks very much like a ISO-standard, I suspect that the blank is not really there, so this will work:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
dt_char = '2019-07-25T15:35';
dt_num = input(dt_char,e8601dt16.);
format dt_num e8601dt16.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;By testing (Maxim 4) I found out that the e8601 informat is tolerant about such blanks anyway:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
dt_char = '2019-07-25T 15:35';
dt_num = input(dt_char,e8601dt20.);
format dt_num e8601dt16.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Jun 2019 06:55:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-Character-date-with-time-in-to-numeric-with-leangth/m-p/565757#M33968</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-06-13T06:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Character date with time in to numeric with leangth of 8</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-Character-date-with-time-in-to-numeric-with-leangth/m-p/565764#M33969</link>
      <description>&lt;P&gt;Its coming correctly but now the value showing like&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token string"&gt;2019-07-25T 15:35:00&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but&amp;nbsp; I need it like&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token string"&gt;2019-07-25T 15:35&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;how to remove the extra zeros&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 07:35:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-Character-date-with-time-in-to-numeric-with-leangth/m-p/565764#M33969</guid>
      <dc:creator>ambadi007</dc:creator>
      <dc:date>2019-06-13T07:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Character date with time in to numeric with leangth of 8</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-Character-date-with-time-in-to-numeric-with-leangth/m-p/565775#M33970</link>
      <description>&lt;P&gt;Then you haven't run &lt;EM&gt;my&lt;/EM&gt; code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
dt_char = '2019-07-25T 15:35';
dt_num = input(dt_char,e8601dt20.);
format dt_num e8601dt16.;
run;

proc print data=test noobs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;     dt_char         dt_num

2019-07-25T 15:35    2019-07-25T15:35
&lt;/PRE&gt;
&lt;P&gt;As you can see, no blanks and no trailing zeroes with the numeric variable.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 08:52:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-Character-date-with-time-in-to-numeric-with-leangth/m-p/565775#M33970</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-06-13T08:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Character date with time in to numeric with leangth of 8</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-Character-date-with-time-in-to-numeric-with-leangth/m-p/565785#M33971</link>
      <description>&lt;P&gt;I have ran the code with&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;e8601dt20 format&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;since I am getting the error like width specified for E8601DT is invalid .. so If iam using&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;&lt;CODE class="  language-sas"&gt;e8601dt20 it is coming with extra zero&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 09:34:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-Character-date-with-time-in-to-numeric-with-leangth/m-p/565785#M33971</guid>
      <dc:creator>ambadi007</dc:creator>
      <dc:date>2019-06-13T09:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Character date with time in to numeric with leangth of 8</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-Character-date-with-time-in-to-numeric-with-leangth/m-p/565798#M33973</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76823"&gt;@ambadi007&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have ran the code with&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;e8601dt20 format&lt;/LI-CODE&gt;
&lt;P&gt;since I am getting the error like width specified for E8601DT is invalid .. so If iam using&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;&lt;CODE class="  language-sas"&gt;e8601dt20 it is coming with extra zero&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Note that my code specifically uses a width of 16 for the display format, and it works and does not display the seconds. If you have further problems, please post your code and log.&lt;/P&gt;
&lt;P&gt;According to the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=leforinforref&amp;amp;docsetTarget=n03vr57gdozvean1klfaaa14c9c0.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;documentation of the E8601 display format&lt;/A&gt; (Maxim 1!), the range for the width is 16 to 26.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 11:04:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Converting-Character-date-with-time-in-to-numeric-with-leangth/m-p/565798#M33973</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-06-13T11:04:06Z</dc:date>
    </item>
  </channel>
</rss>

