<?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: Reading a CSV file; datetime variable returning missing values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-CSV-file-datetime-variable-returning-missing-values/m-p/240769#M44480</link>
    <description>&lt;P&gt;Maybe the problem is that csv file is created under Windows, while you are importing it via Unix . They have different terminator character of line .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data control;
infile '/folders/myfolders/temp.txt' dsd truncover firstobs=2 termstr=crlf;
input
	first_ID	: $20.
	second_ID	: $20.
	name	    : $50.
	Rec_Date	: anydtdtm.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 24 Dec 2015 05:15:50 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2015-12-24T05:15:50Z</dc:date>
    <item>
      <title>Reading a CSV file; datetime variable returning missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-CSV-file-datetime-variable-returning-missing-values/m-p/240760#M44472</link>
      <description>&lt;P class=" language-sas"&gt;Good evening,&lt;/P&gt;
&lt;P class=" language-sas"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=" language-sas"&gt;The code below is producing missing values for all values of the Rec_Date variable.&amp;nbsp; This is running on 9.2&amp;nbsp; in UNIX.&lt;/P&gt;
&lt;P&gt;Sample data appears as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"First ID","Second ID","Name","Rec Date"&lt;BR /&gt;"121","012","Martin","2015/12/22 00:00:00"&lt;BR /&gt;"1956","056","Breida","2015/11/22 00:00:00"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can someone help me understand what I'm missing?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data control;

length
	first_ID		$20
	second_ID	$20
	name	        $50;
infile control dsd missover firstobs=2;
input
	first_ID		$
	second_ID	$
	name	         $
	Rec_Date	         anydtdtm.;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Dec 2015 03:42:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-CSV-file-datetime-variable-returning-missing-values/m-p/240760#M44472</guid>
      <dc:creator>old_man_hank</dc:creator>
      <dc:date>2015-12-24T03:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a CSV file; datetime variable returning missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-CSV-file-datetime-variable-returning-missing-values/m-p/240762#M44473</link>
      <description>&lt;P&gt;Could you try to change the informat used for reading the datetime like below , i used the colon (:) and the informat to anydtdtm20. .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data control;

length
	first_ID		$20
	second_ID	$20
	name	        $50;
infile control dsd missover firstobs=2;
input
	first_ID		$
	second_ID	$
	name	         $
	Rec_Date	 :        anydtdtm20.;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2015 04:05:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-CSV-file-datetime-variable-returning-missing-values/m-p/240762#M44473</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2015-12-24T04:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a CSV file; datetime variable returning missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-CSV-file-datetime-variable-returning-missing-values/m-p/240769#M44480</link>
      <description>&lt;P&gt;Maybe the problem is that csv file is created under Windows, while you are importing it via Unix . They have different terminator character of line .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data control;
infile '/folders/myfolders/temp.txt' dsd truncover firstobs=2 termstr=crlf;
input
	first_ID	: $20.
	second_ID	: $20.
	name	    : $50.
	Rec_Date	: anydtdtm.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Dec 2015 05:15:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-CSV-file-datetime-variable-returning-missing-values/m-p/240769#M44480</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-12-24T05:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a CSV file; datetime variable returning missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-CSV-file-datetime-variable-returning-missing-values/m-p/240817#M44498</link>
      <description>&lt;P&gt;Thanks Ksharp!&amp;nbsp; That is exactly what the issue was.&amp;nbsp; Apparently UNIX uses a "LF" to terminate the line while files created in Windows have the "CRLF".&amp;nbsp; Once I specified that the terminator characater is "CRLF", the file read the date without issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/sgf/2015/04/17/turning-text-files-into-sas-data-sets-6-common-problems-and-their-solutions/" target="_blank"&gt;Text file common problems&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2015 16:27:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-CSV-file-datetime-variable-returning-missing-values/m-p/240817#M44498</guid>
      <dc:creator>old_man_hank</dc:creator>
      <dc:date>2015-12-24T16:27:38Z</dc:date>
    </item>
  </channel>
</rss>

