<?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: Informat CSV Date with type &amp;quot;2017-01-01 00:00:00&amp;quot; in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Informat-CSV-Date-with-type-quot-2017-01-01-00-00-00-quot/m-p/512873#M2458</link>
    <description>&lt;P&gt;You are using the wrong informat. MMDDYY expects a MDY order, but you have a YMD order in your data.&lt;/P&gt;
&lt;P&gt;Use YYMMDD instead:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
instring = "2017-01-01 00:00:00";
date_value = input(instring,yymmdd10.);
format date_value yymmddd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 14 Nov 2018 09:42:06 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-11-14T09:42:06Z</dc:date>
    <item>
      <title>Informat CSV Date with type "2017-01-01 00:00:00"</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Informat-CSV-Date-with-type-quot-2017-01-01-00-00-00-quot/m-p/512865#M2453</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;a csv data file consists of a variable "date" with the following type "2017-01-01 00:00:00"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can import such an type. I don't need the information of time "00:00:00"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So MMDDYY10. would be fine, but it does not work. The result is a missing value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 09:23:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Informat-CSV-Date-with-type-quot-2017-01-01-00-00-00-quot/m-p/512865#M2453</guid>
      <dc:creator>Dynamike</dc:creator>
      <dc:date>2018-11-14T09:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Informat CSV Date with type "2017-01-01 00:00:00"</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Informat-CSV-Date-with-type-quot-2017-01-01-00-00-00-quot/m-p/512871#M2456</link>
      <description>&lt;P&gt;Use the format ymddttm to read in the data, then datepart() that, e.g.:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003172040.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003172040.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 09:41:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Informat-CSV-Date-with-type-quot-2017-01-01-00-00-00-quot/m-p/512871#M2456</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-11-14T09:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Informat CSV Date with type "2017-01-01 00:00:00"</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Informat-CSV-Date-with-type-quot-2017-01-01-00-00-00-quot/m-p/512873#M2458</link>
      <description>&lt;P&gt;You are using the wrong informat. MMDDYY expects a MDY order, but you have a YMD order in your data.&lt;/P&gt;
&lt;P&gt;Use YYMMDD instead:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
instring = "2017-01-01 00:00:00";
date_value = input(instring,yymmdd10.);
format date_value yymmddd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Nov 2018 09:42:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Informat-CSV-Date-with-type-quot-2017-01-01-00-00-00-quot/m-p/512873#M2458</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-14T09:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Informat CSV Date with type "2017-01-01 00:00:00"</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Informat-CSV-Date-with-type-quot-2017-01-01-00-00-00-quot/m-p/512901#M2466</link>
      <description>thank you! That works!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But, if there is more than one instring e.g.&lt;BR /&gt;&lt;BR /&gt;"2017-01-01 00:00:00"&lt;BR /&gt;&lt;BR /&gt;"2018-03-25 00:00:00"&lt;BR /&gt;&lt;BR /&gt;"2016-05-03 00:00:00"&lt;BR /&gt;&lt;BR /&gt;my solution would be:&lt;BR /&gt;&lt;BR /&gt;DATA Test_Out;&lt;BR /&gt;LENGTH tod_datum $ 10;&lt;BR /&gt;&lt;BR /&gt;FORMAT tod_datum yymmddd10.;&lt;BR /&gt;&lt;BR /&gt;INFORMAT tod_datum yymmddd10.;&lt;BR /&gt;&lt;BR /&gt;INFILE 'C:\Test_In.csv'&lt;BR /&gt;delimiter=','&lt;BR /&gt;MISSOVER&lt;BR /&gt;firstobs=2&lt;BR /&gt;DSD&lt;BR /&gt;LRECL=32767;&lt;BR /&gt;INPUT tod_datum : ?? $CHAR23.&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;Data test_out;&lt;BR /&gt;Set test_out;&lt;BR /&gt;todtag=input(tod_datum,yymmdd10.);&lt;BR /&gt;format todtag ddmmyy10.;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This works, but is there no direct way? informat not as a string, but another date format (E8601DTw.d seems to be similar, but does not work).&lt;BR /&gt;Or is there another way to avoid the second data step?&lt;BR /&gt;&lt;BR /&gt;Thank u for ur effort!&lt;BR /&gt;&lt;BR /&gt;Mike&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Nov 2018 11:01:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Informat-CSV-Date-with-type-quot-2017-01-01-00-00-00-quot/m-p/512901#M2466</guid>
      <dc:creator>Dynamike</dc:creator>
      <dc:date>2018-11-14T11:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Informat CSV Date with type "2017-01-01 00:00:00"</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Informat-CSV-Date-with-type-quot-2017-01-01-00-00-00-quot/m-p/513000#M2479</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/164229"&gt;@Dynamike&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;thank you! That works!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But, if there is more than one instring e.g.&lt;BR /&gt;&lt;BR /&gt;"2017-01-01 00:00:00"&lt;BR /&gt;&lt;BR /&gt;"2018-03-25 00:00:00"&lt;BR /&gt;&lt;BR /&gt;"2016-05-03 00:00:00"&lt;BR /&gt;&lt;BR /&gt;my solution would be:&lt;BR /&gt;&lt;BR /&gt;DATA Test_Out;&lt;BR /&gt;LENGTH tod_datum $ 10;&lt;BR /&gt;&lt;BR /&gt;FORMAT tod_datum yymmddd10.;&lt;BR /&gt;&lt;BR /&gt;INFORMAT tod_datum yymmddd10.;&lt;BR /&gt;&lt;BR /&gt;INFILE 'C:\Test_In.csv'&lt;BR /&gt;delimiter=','&lt;BR /&gt;MISSOVER&lt;BR /&gt;firstobs=2&lt;BR /&gt;DSD&lt;BR /&gt;LRECL=32767;&lt;BR /&gt;INPUT tod_datum : ?? &lt;STRONG&gt;&lt;FONT color="#ff0000" size="5"&gt;$CHAR23&lt;/FONT&gt;&lt;/STRONG&gt;.&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;Data test_out;&lt;BR /&gt;Set test_out;&lt;BR /&gt;todtag=input(tod_datum,yymmdd10.);&lt;BR /&gt;format todtag ddmmyy10.;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This works, but is there no direct way? informat not as a string, but another date format (E8601DTw.d seems to be similar, but does not work).&lt;BR /&gt;Or is there another way to avoid the second data step?&lt;BR /&gt;&lt;BR /&gt;Thank u for ur effort!&lt;BR /&gt;&lt;BR /&gt;Mike&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Why did you go to the trouble of setting a character length and then assigning&amp;nbsp;numerical informat&amp;nbsp;and formats and then forcing it to be read as character? Also the informat you want is likely&lt;/P&gt;
&lt;P&gt;YYMMDD10 not YYMMDD&lt;STRONG&gt;D&lt;/STRONG&gt;10.&amp;nbsp; The informat does not want or need&amp;nbsp;the separator provided.&lt;/P&gt;
&lt;P&gt;If you want an actual SAS date value then this should work&lt;/P&gt;
&lt;PRE&gt;DATA Test_Out;
   FORMAT tod_datum yymmddd10.;

   INFORMAT tod_datum yymmdd10.;

   INFILE 'C:\Test_In.csv' delimiter=',' MISSOVER firstobs=2 DSD
       LRECL=32767;
INPUT tod_datum .
RUN;&lt;/PRE&gt;
&lt;P&gt;If you want a CHARACTER value then just read the number of characters but the mishmash of code makes it hard to tell which you actually want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 16:26:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Informat-CSV-Date-with-type-quot-2017-01-01-00-00-00-quot/m-p/513000#M2479</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-11-14T16:26:15Z</dc:date>
    </item>
  </channel>
</rss>

