<?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: Import dates variable from CSV in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282338#M57379</link>
    <description>&lt;P&gt;How was the CSV file created? What encoding was used? Did SAS properly detect the encoding? &amp;nbsp;Are the characters consistent with the encoding?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you post an example file with 2 or 3 columns and 3 or 4 rows?&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jul 2016 03:08:41 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2016-07-06T03:08:41Z</dc:date>
    <item>
      <title>Import dates variable from CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282076#M57281</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to import a CSV file in SAS Base 9.4. I have tried both Proc import and import wizard but I am getting just '1' in the place of dates and by default its taking text format. I tried format but I get error saying I can not use format.&lt;/P&gt;&lt;P&gt;The data in csv is something like this( this is dummy example just for reference). Funniest part is SAS is interpreting the last date column correctly but not the first one.&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp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&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apart from import wizard I used following code&lt;/P&gt;&lt;P&gt;proc import datafile = "Chjkj.csv"&lt;BR /&gt;out = c11&lt;BR /&gt;dbms = csv&lt;BR /&gt;replace;&lt;BR /&gt;getnames = yes;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance !&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 05:00:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282076#M57281</guid>
      <dc:creator>deega</dc:creator>
      <dc:date>2016-07-05T05:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Import dates variable from CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282077#M57282</link>
      <description>&lt;P&gt;proc import datafile = "Chjkj.csv"&lt;BR /&gt;out = c11&lt;BR /&gt;dbms = csv&lt;BR /&gt;replace;&lt;BR /&gt;getnames = yes;&lt;BR /&gt;&lt;STRONG&gt;guessingrows=32767;&lt;/STRONG&gt;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 05:10:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282077#M57282</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-07-05T05:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: Import dates variable from CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282078#M57283</link>
      <description>&lt;P&gt;Also, when you use proc import look at your log. It has the data step code. Copy that to your editor and edit the fields that aren't being imported properly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can copy the code without line numbers by pressing ALT+highlighting the code without line numbers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 05:15:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282078#M57283</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-07-05T05:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: Import dates variable from CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282079#M57284</link>
      <description>Wow ! Its working.... I wasted so many hours in this.....Thank you so much !&lt;BR /&gt;But</description>
      <pubDate>Tue, 05 Jul 2016 05:15:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282079#M57284</guid>
      <dc:creator>deega</dc:creator>
      <dc:date>2016-07-05T05:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: Import dates variable from CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282080#M57285</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;
&lt;P&gt;your code does not have problem, tried same and working fine.&lt;/P&gt;
&lt;P&gt;Check if all your sas components are installed correctly i.e SAS/ACCESS and SAS/CONNECT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc import datafile = "C:\Users\ak26\Desktop\Book1.csv"&lt;BR /&gt;out = c11&lt;BR /&gt;dbms = csv&lt;BR /&gt;replace;&lt;BR /&gt;getnames =yes;&lt;BR /&gt;run;&lt;BR /&gt;proc print;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS Output&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;TABLE class="systitleandfootercontainer" border="0" summary="Page Layout" width="100%" frame="void" rules="none" cellspacing="1" cellpadding="1"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="c systemtitle"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; The SAS System&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;BR /&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.C11" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;Obs&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;A&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;b&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;c&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;d&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;e&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;f&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;g&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="r data"&gt;132&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;erf&lt;/TD&gt;
&lt;TD class="r data"&gt;8363&lt;/TD&gt;
&lt;TD class="r data"&gt;03/11/1997&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="r data"&gt;135&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="r data"&gt;08/02/1955&lt;/TD&gt;
&lt;TD class="l data"&gt;erg&lt;/TD&gt;
&lt;TD class="r data"&gt;4734&lt;/TD&gt;
&lt;TD class="r data"&gt;03/11/1997&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;3&lt;/TH&gt;
&lt;TD class="r data"&gt;132&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;erf&lt;/TD&gt;
&lt;TD class="r data"&gt;620&lt;/TD&gt;
&lt;TD class="r data"&gt;03/11/1997&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;4&lt;/TH&gt;
&lt;TD class="r data"&gt;444&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="l data"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;TD class="l data"&gt;ergf&lt;/TD&gt;
&lt;TD class="r data"&gt;9192&lt;/TD&gt;
&lt;TD class="r data"&gt;03/11/1997&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 05 Jul 2016 05:19:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282080#M57285</guid>
      <dc:creator>LittlesasMaster</dc:creator>
      <dc:date>2016-07-05T05:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Import dates variable from CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282081#M57286</link>
      <description>&lt;P&gt;Is there any solution&amp;nbsp;for this problem also....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;even after using getnames=yes, my SAS table does not take the variable names from CSV file, instead it names it VAR1 VAR2... and so on.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 06:05:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282081#M57286</guid>
      <dc:creator>deega</dc:creator>
      <dc:date>2016-07-05T06:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: Import dates variable from CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282090#M57287</link>
      <description>&lt;P&gt;That is really weird. is your data starting from first row ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Try option: &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;datarow=3;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Better post your sample data to let us test it .&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 07:02:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282090#M57287</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-07-05T07:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: Import dates variable from CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282171#M57313</link>
      <description>&lt;P&gt;GETNAMES assumes the variable names are on the first row. If for some reason they aren't then you'll get that behavior and possibly some variables that should be numeric end up character as the name is treated as a data value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also a good diagnostic when using proc import for delimited files is the log. It will contain the datastep code generated to read the data.&lt;/P&gt;
&lt;P&gt;Sometimes it is best to copy the code from the log and modify to your needs such as setting consistent lengths for similar variables, especially if you are going to combine datasets, spellings of variable names and it often is a good idea to add variable labels.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 15:13:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282171#M57313</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-07-05T15:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: Import dates variable from CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282337#M57378</link>
      <description>&lt;P&gt;I have found the reason of this weird behaviour. My Variable names are in Japanese, my program read it correctly when I changed them in source CSV. However, even the Japanese version of SAS is not reading the Japanese fonts and naming them as var1 var2 ... and so on. If you have any idea of how to&amp;nbsp;solve this problem, please tell me.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 02:57:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282337#M57378</guid>
      <dc:creator>deega</dc:creator>
      <dc:date>2016-07-06T02:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Import dates variable from CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282338#M57379</link>
      <description>&lt;P&gt;How was the CSV file created? What encoding was used? Did SAS properly detect the encoding? &amp;nbsp;Are the characters consistent with the encoding?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you post an example file with 2 or 3 columns and 3 or 4 rows?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 03:08:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282338#M57379</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-07-06T03:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Import dates variable from CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282870#M57555</link>
      <description>CSV files are not created at my end. I get data from the client in the form of CSV files. Where can I find SAS encoding ?</description>
      <pubDate>Fri, 08 Jul 2016 06:59:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282870#M57555</guid>
      <dc:creator>deega</dc:creator>
      <dc:date>2016-07-08T06:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Import dates variable from CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282872#M57556</link>
      <description>&lt;P&gt;Assuming you know the encoding you can specify it on the infile statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Heres a link on how to find your encoding.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://programmers.stackexchange.com/questions/187169/how-to-detect-the-encoding-of-a-file" target="_blank"&gt;http://programmers.stackexchange.com/questions/187169/how-to-detect-the-encoding-of-a-file&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2016 07:14:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-dates-variable-from-CSV/m-p/282872#M57556</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-07-08T07:14:11Z</dc:date>
    </item>
  </channel>
</rss>

