<?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: Importing issue in csv file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Importing-issue-in-csv-file/m-p/410697#M100353</link>
    <description>&lt;P&gt;Post your full log if you want help with the error messages.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my opinion, the INFILE statement in the data step is a much better choice when you want to import csv files:)&lt;/P&gt;</description>
    <pubDate>Sun, 05 Nov 2017 19:26:31 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2017-11-05T19:26:31Z</dc:date>
    <item>
      <title>Importing issue in csv file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-issue-in-csv-file/m-p/410696#M100352</link>
      <description>&lt;P&gt;I'm having issues importing a csv.&amp;nbsp;I'm using the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname xplant&lt;STRONG&gt; "/folders/&lt;/STRONG&gt;myfolders&lt;STRONG&gt;/Transplant";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc import out = xplant.xplantnew&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;DATAFILE = "/folders/myfolders/Transplant/xplantnew.csv"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;DBMS = csv REPLACE;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It still produces a large set of output data but there are also many errors in the log. For example, at the beginning, it reports:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasSource"&gt;&lt;STRONG&gt;NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&lt;STRONG&gt;WORK.PARMS.PARMS.SLIST.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;And at the end, it reports:&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&lt;STRONG&gt;Errors detected in &lt;/STRONG&gt;submitted&lt;STRONG&gt; DATA step. Examine log.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&lt;STRONG&gt;20021 rows created in XPLANT.XPLANTNEW from /folders/&lt;/STRONG&gt;myfolders&lt;STRONG&gt;/Transplant/xplantnew.csv.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&lt;STRONG&gt;ERROR: Import unsuccessful. See SAS Log for details.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;I have used this exact code with a an earlier verison&amp;nbsp;of the csv&amp;nbsp;but I've had more columns added. I'm not sure what the difference is and why it isn't' working properly anymore.&lt;/DIV&gt;</description>
      <pubDate>Sun, 05 Nov 2017 19:10:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-issue-in-csv-file/m-p/410696#M100352</guid>
      <dc:creator>SaraDianaPasik</dc:creator>
      <dc:date>2017-11-05T19:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: Importing issue in csv file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-issue-in-csv-file/m-p/410697#M100353</link>
      <description>&lt;P&gt;Post your full log if you want help with the error messages.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my opinion, the INFILE statement in the data step is a much better choice when you want to import csv files:)&lt;/P&gt;</description>
      <pubDate>Sun, 05 Nov 2017 19:26:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-issue-in-csv-file/m-p/410697#M100353</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-11-05T19:26:31Z</dc:date>
    </item>
    <item>
      <title>Re: Importing issue in csv file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-issue-in-csv-file/m-p/410698#M100354</link>
      <description>&lt;P&gt;You need to post the actual error.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first &lt;SPAN&gt;message&amp;nbsp;&lt;/SPAN&gt;you posted is just caused by a bug in PROC IMPORT.&amp;nbsp; It expects to be able to write to the SASUSER library, which is stupid since there exists a SAS option (RSASUSER) that is specifically designed to prevent writing to the SASUSER library.&amp;nbsp; This note does not mean that PROC IMPORT had any real trouble.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The second message is generated by PROC IMPORT after the data step that it wrote to read the data has finished to let you know that the data step had one or more errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to look in the log between those two messages to see the data step that PROC IMPORT generated and find the error messages that the data step generated.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Nov 2017 19:29:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-issue-in-csv-file/m-p/410698#M100354</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-11-05T19:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Importing issue in csv file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-issue-in-csv-file/m-p/410700#M100355</link>
      <description>&lt;DIV class="sasSource"&gt;&amp;nbsp;It's super long, so I wasn't sure if I should include the whole thing. But I frankly don't know which parts are important. So, here goes -- see attached.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Sun, 05 Nov 2017 19:30:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-issue-in-csv-file/m-p/410700#M100355</guid>
      <dc:creator>SaraDianaPasik</dc:creator>
      <dc:date>2017-11-05T19:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Importing issue in csv file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-issue-in-csv-file/m-p/410705#M100356</link>
      <description>&lt;P&gt;Here is the first error message.&lt;/P&gt;
&lt;PRE&gt; NOTE: Invalid data for Other_Diagnosis_Codes_5 in line 38 353-357.
 RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0                      
 38        64478,19950001744167.0,Fc/wYN4Vjz6mC0hgOMCNsgbFY05zOTF6KKbXll60qe+w,1967-04,27.0,M,01,2,MASPETH,NY,1
      101  1378,61, ,001458,New York Presbyterian Hospital - New York Weill Cornell Center,7.0,09,60.0,7002054.
      201  0,,00091528,00091528, ,,,,C, , , , , ,03, , , ,1995-01,1995-01,1995-01-09,MON,10.0,2,1995-01-25,WED,
      301  14.0,16.0,0,01,2,3,1,585,40391,25041,9952,5990,0414,E9331, , , , , , , , , , , , , , , , , , , ,9,9,
      401  9,9,9, , , , , , , , , , , , , , , , , , , , , , , , ,5569,1995-01,+,0001,15.0,5523,8877,9203,8875,3
      501  995,9917,9923,9921, , , , , , ,1995-01,1995-01,1995-01,1995-01,1995-01,1995-01,1995-01,1995-01, , , 
      601  , , , ,+,+,+,+,+,+,+,+, , , , , , , ,40.0,0.0,,,,,3958942.0,1760000.0,2198942.0,0.0,0.0,0.0,1995-01-
      701  25,1995-01-09,2009.0,99681,5523,2303.0,1.0,2010.0,99999.0,0.0,0.0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
      801  0,0,0.0,1,1,57127,88.92613351877625,72.0,3.0,58.0,3.0,1995-01-25,1,1700,8059883.170812558,0.0,332979
      901  4.7698810836,0.0,0.0,0.0 924
&lt;/PRE&gt;
&lt;P&gt;PROC IMPORT decided that&amp;nbsp;Other_Diagnosis_Codes_5 should be a number,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format Other_Diagnosis_Codes_5 best12. ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but it looks like the value starts with the letter E.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add the GUESSINGROWS statement to your PROC IMPORT code so that you can tell it to look at more lines of data before making its guess as to what the variables are.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=proc&amp;amp;docsetTarget=p13kvtl8ezj13in17i6m99jypcwi.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=proc&amp;amp;docsetTarget=p13kvtl8ezj13in17i6m99jypcwi.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Better still would be to remove the PROC IMPORT step and just write your own data step to read the data.&amp;nbsp; Sounds like you have created the CSV file so you should know what the columns are without having to guess whether they are numbers or character strings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Nov 2017 19:45:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-issue-in-csv-file/m-p/410705#M100356</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-11-05T19:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Importing issue in csv file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-issue-in-csv-file/m-p/410708#M100358</link>
      <description>&lt;P&gt;This worked, thanks a million!&lt;/P&gt;</description>
      <pubDate>Sun, 05 Nov 2017 19:55:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-issue-in-csv-file/m-p/410708#M100358</guid>
      <dc:creator>SaraDianaPasik</dc:creator>
      <dc:date>2017-11-05T19:55:39Z</dc:date>
    </item>
  </channel>
</rss>

