<?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: imcomplete datetime values like &amp;quot;2013-12-16 08:&amp;quot; cause missing values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/imcomplete-datetime-values-like-quot-2013-12-16-08-quot-cause/m-p/240690#M44452</link>
    <description>Hi Tom&lt;BR /&gt;&lt;BR /&gt;Yes, it works. Not sure what I did yesterday, but today when I came back to office and tested again, and it works. &lt;BR /&gt;&lt;BR /&gt;Thank you very much!</description>
    <pubDate>Wed, 23 Dec 2015 19:49:06 GMT</pubDate>
    <dc:creator>fengyuwuzu</dc:creator>
    <dc:date>2015-12-23T19:49:06Z</dc:date>
    <item>
      <title>imcomplete datetime values like "2013-12-16 08:" cause missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/imcomplete-datetime-values-like-quot-2013-12-16-08-quot-cause/m-p/240530#M44386</link>
      <description>&lt;P&gt;I have a datetime variable with values like "2014-02-10 01:11:50". They were imported as $19. I tried to use "usedate= yes", but it gave error message.&lt;/P&gt;
&lt;P&gt;So I tried to change the datetime format after imported in as $19.&amp;nbsp; format, and then using the following codes to convert to datetime.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; registration_time =input(registration_timestamp,anydtdtm.);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format registration_time datetime19.;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;however, some values are imcomplete, like "2013-12-16 08:", and in this case, the new varible registration_time was set to missing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I avoid the missing values? actually i do not need the hh:mm:ss part, and I checked the data and all imcomplete ones are in the hh:mm:ss part.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 20:29:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/imcomplete-datetime-values-like-quot-2013-12-16-08-quot-cause/m-p/240530#M44386</guid>
      <dc:creator>fengyuwuzu</dc:creator>
      <dc:date>2015-12-22T20:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: imcomplete datetime values like "2013-12-16 08:" cause missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/imcomplete-datetime-values-like-quot-2013-12-16-08-quot-cause/m-p/240546#M44390</link>
      <description>&lt;P&gt;If the values always have 10 digits of date values then juse a different INFORMAT.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;registration_date =input(registration_timestamp,yymmdd10.);
format registration_date yymmdd10. ;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If the date part might be shorter because of single digit month and/or day then you migth first need to eliminate the time part.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;registration_date =input(scan(registration_timestamp,1,' '),yymmdd10.);
format registration_date yymmdd10. ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Dec 2015 20:59:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/imcomplete-datetime-values-like-quot-2013-12-16-08-quot-cause/m-p/240546#M44390</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-12-22T20:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: imcomplete datetime values like "2013-12-16 08:" cause missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/imcomplete-datetime-values-like-quot-2013-12-16-08-quot-cause/m-p/240553#M44397</link>
      <description>when I used &lt;BR /&gt;registration_date =input(registration_timestamp,yymmdd10.);&lt;BR /&gt;format registration_date yymmdd10. ;&lt;BR /&gt;&lt;BR /&gt;all registration_date values became missing values.</description>
      <pubDate>Tue, 22 Dec 2015 21:08:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/imcomplete-datetime-values-like-quot-2013-12-16-08-quot-cause/m-p/240553#M44397</guid>
      <dc:creator>fengyuwuzu</dc:creator>
      <dc:date>2015-12-22T21:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: imcomplete datetime values like "2013-12-16 08:" cause missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/imcomplete-datetime-values-like-quot-2013-12-16-08-quot-cause/m-p/240574#M44403</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;241  data x;
242    registration_timestamp='2013-12-16 08:';
243    registration_date =input(registration_timestamp,yymmdd10.);
244    format registration_date yymmdd10. ;
245    put (_all_) (=);
246  run;

registration_timestamp=2013-12-16 08: registration_date=2013-12-16
NOTE: The data set WORK.X has 1 observations and 2 variables.
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN style="line-height: 20px;"&gt;Perhaps the values have leading spaces?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;What happened when you used the SCAN() function?&lt;/P&gt;
&lt;P&gt;Perhaps that is not a space between the day and the hour, but some other character? &amp;nbsp;Perhaps that is not a hyphen but some other character?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 22:51:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/imcomplete-datetime-values-like-quot-2013-12-16-08-quot-cause/m-p/240574#M44403</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-12-22T22:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: imcomplete datetime values like "2013-12-16 08:" cause missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/imcomplete-datetime-values-like-quot-2013-12-16-08-quot-cause/m-p/240690#M44452</link>
      <description>Hi Tom&lt;BR /&gt;&lt;BR /&gt;Yes, it works. Not sure what I did yesterday, but today when I came back to office and tested again, and it works. &lt;BR /&gt;&lt;BR /&gt;Thank you very much!</description>
      <pubDate>Wed, 23 Dec 2015 19:49:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/imcomplete-datetime-values-like-quot-2013-12-16-08-quot-cause/m-p/240690#M44452</guid>
      <dc:creator>fengyuwuzu</dc:creator>
      <dc:date>2015-12-23T19:49:06Z</dc:date>
    </item>
  </channel>
</rss>

