<?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: Problem in import .csv file in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Problem-in-import-csv-file/m-p/168989#M43701</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, gonna sound like a broken record here, but I would advise to use datastep code to read in any file.&amp;nbsp; With proc import you are letting SAS guess what should be done.&amp;nbsp; It should be the other way round, you, who knows the data, should tell SAS what to import.&amp;nbsp; The code below gives exactly the same output, and can be manipulated:&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length var1 $200.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile "s:\temp\rob\a.csv" dlm="," missover dsd lrecl=32767;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input var1 $ var2 var3 var4 var5 var6 var7;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Nov 2014 09:19:02 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2014-11-13T09:19:02Z</dc:date>
    <item>
      <title>Problem in import .csv file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-in-import-csv-file/m-p/168985#M43697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I am beginner in SAS.&amp;nbsp;&amp;nbsp; I was trying to import a .csv file using IMPORT command using code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC IMPORT DATAFILE="D:\work\octbr\problemex\sample.csv"&lt;/P&gt;&lt;P&gt;OUT=marks&lt;/P&gt;&lt;P&gt;DBMS=CSV&lt;/P&gt;&lt;P&gt;REPLACE;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its showing the error that the import file is failed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried many ways to import but failed to import....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest me how to clear the error and import the data file...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srujana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Nov 2014 07:44:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-in-import-csv-file/m-p/168985#M43697</guid>
      <dc:creator>srujanaparcha</dc:creator>
      <dc:date>2014-11-13T07:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in import .csv file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-in-import-csv-file/m-p/168986#M43698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please post a sample (first 10 lines or so) of the csv file and the actual log of the proc import with the error message.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Nov 2014 07:54:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-in-import-csv-file/m-p/168986#M43698</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-11-13T07:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in import .csv file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-in-import-csv-file/m-p/168987#M43699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this is my sample file data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;abcd-AA-45,-0.054829956,-0.046428462,26,29,33,26,41&lt;/P&gt;&lt;P&gt;abcd-AA-44,0.072182266,0.075878166,22,39,34,17,37&lt;/P&gt;&lt;P&gt;abcd-AA-41,-0.242498969,-0.183132623,17,29,32,31,22&lt;/P&gt;&lt;P&gt;abcd-AA-34,0.119176859,0.184544889,26,44,33,14,39&lt;/P&gt;&lt;P&gt;abcd-AA-31,-0.163328092,-0.048343209,34,33,31,18,31&lt;/P&gt;&lt;P&gt;abcd-AA-25,-0.181906429,-0.25667866,23,24,25,22,28&lt;/P&gt;&lt;P&gt;abcd-AA-24,-0.197937552,-0.074703951,26,33,36,19,37&lt;/P&gt;&lt;P&gt;abcd-AA-22,-0.102977317,0.152645372,32,32,32,23,33&lt;/P&gt;&lt;P&gt;abcd-AA-13,0.187188343,-0.023572483,20,33,30,16,41&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written the following code &lt;/P&gt;&lt;P&gt;PROC IMPORT DATAFILE="D:\work\octbr\problemex\sample.csv"&lt;/P&gt;&lt;P&gt;OUT=marks&lt;/P&gt;&lt;P&gt;DBMS=CSV&lt;/P&gt;&lt;P&gt;REPLACE;&lt;/P&gt;&lt;P&gt;GETNAMES=yes;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;PROC PRINT DATA=marks;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And this is the error report generated&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="sasError focus-line" id="sasLogError1_1415869204460" style="color: red; background-color: #c5ced8;"&gt; ERROR: Import unsuccessful. See SAS Log for details.&lt;P&gt;&lt;/P&gt;&lt;P class="sasNote" id="sasLogNote1_1415869204460" style="color: #0000ff;"&gt; NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P class="sasNote" id="sasLogNote2_1415869204460" style="color: #0000ff;"&gt; NOTE: PROCEDURE IMPORT used (Total process time):&lt;/P&gt;&lt;P class="sasNote" style="color: #0000ff;"&gt;&amp;nbsp; real time 0.09 seconds&lt;/P&gt;&lt;P class="sasNote" style="color: #0000ff;"&gt;&amp;nbsp; user cpu time 0.03 seconds&lt;/P&gt;&lt;P class="sasNote" style="color: #0000ff;"&gt;&amp;nbsp; system cpu time 0.02 seconds&lt;/P&gt;&lt;P class="sasNote" style="color: #0000ff;"&gt;&amp;nbsp; memory 8928.50k&lt;/P&gt;&lt;P class="sasNote" style="color: #0000ff;"&gt;&amp;nbsp; OS Memory 32004.00k&lt;/P&gt;&lt;P class="sasNote" style="color: #0000ff;"&gt;&amp;nbsp; Timestamp 11/13/2014 08:57:49 AM&lt;/P&gt;&lt;P class="sasNote" style="color: #0000ff;"&gt;&amp;nbsp; Step Count 7 Switch Count 49&lt;/P&gt;&lt;P class="sasNote" style="color: #0000ff;"&gt;&amp;nbsp; Page Faults 0&lt;/P&gt;&lt;P class="sasNote" style="color: #0000ff;"&gt;&amp;nbsp; Page Reclaims 2724&lt;/P&gt;&lt;P class="sasNote" style="color: #0000ff;"&gt;&amp;nbsp; Page Swaps 0&lt;/P&gt;&lt;P class="sasNote" style="color: #0000ff;"&gt;&amp;nbsp; Voluntary Context Switches 228&lt;/P&gt;&lt;P class="sasNote" style="color: #0000ff;"&gt;&amp;nbsp; Involuntary Context Switches 27&lt;/P&gt;&lt;P class="sasNote" style="color: #0000ff;"&gt;&amp;nbsp; Block Input Operations 0&lt;/P&gt;&lt;P class="sasNote" style="color: #0000ff;"&gt;&amp;nbsp; Block Output Operations 72&lt;/P&gt;&lt;P class="sasNote" style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="sasSource" style="color: #000000;"&gt; 64 PROC PRINT DATA=marks;&lt;P&gt;&lt;/P&gt;&lt;P class="sasError" id="sasLogError2_1415869204460" style="color: red;"&gt; ERROR: File WORK.MARKS.DATA does not exist.&lt;/P&gt;&lt;P class="sasSource" style="color: #000000;"&gt; 65 RUN;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Nov 2014 08:59:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-in-import-csv-file/m-p/168987#M43699</guid>
      <dc:creator>srujanaparcha</dc:creator>
      <dc:date>2014-11-13T08:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in import .csv file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-in-import-csv-file/m-p/168988#M43700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try with this code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;PROC IMPORT DATAFILE="D:\work\octbr\problemex\sample.csv"&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;OUT=marks&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;DBMS=CSV&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;REPLACE;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;GETNAMES=NO;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;GUESSINGROWS=1000;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;RUN;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;If your data is like your sample, you must put getnames=NO since it doesn't have a column name. Also I have added guessingrows that produce that SAS import more lines before appling a format.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Nov 2014 09:07:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-in-import-csv-file/m-p/168988#M43700</guid>
      <dc:creator>arodriguez</dc:creator>
      <dc:date>2014-11-13T09:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in import .csv file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-in-import-csv-file/m-p/168989#M43701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, gonna sound like a broken record here, but I would advise to use datastep code to read in any file.&amp;nbsp; With proc import you are letting SAS guess what should be done.&amp;nbsp; It should be the other way round, you, who knows the data, should tell SAS what to import.&amp;nbsp; The code below gives exactly the same output, and can be manipulated:&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length var1 $200.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile "s:\temp\rob\a.csv" dlm="," missover dsd lrecl=32767;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input var1 $ var2 var3 var4 var5 var6 var7;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Nov 2014 09:19:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-in-import-csv-file/m-p/168989#M43701</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-11-13T09:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in import .csv file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-in-import-csv-file/m-p/168990#M43702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If that is your file (and you have not omitted the first line), then getnames=yes is, of course, wrong.&lt;/P&gt;&lt;P&gt;Without a line containinmg column names, you are much better off with a manually written data step.&lt;/P&gt;&lt;P&gt;You're better off with a data step, anyway; I strongly second RW9 here. PROC IMPORT may tolerate erroneous data that will cause ERRORs later on (like character data in a column that is expected to be numeric)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Nov 2014 09:36:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-in-import-csv-file/m-p/168990#M43702</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-11-13T09:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in import .csv file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-in-import-csv-file/m-p/168991#M43703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what kind of SAS are you running?&lt;/P&gt;&lt;P&gt;E G, SAS/Studio or base SAS?&lt;/P&gt;&lt;P&gt;On what platform is your sas server running?&lt;/P&gt;&lt;P&gt;Please report the result of running&lt;/P&gt;&lt;P&gt;%put _automatic_ ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In particular SYSSCP, and SYSSCPL should show if you are running in an environment that can read from "D:\work\octbr\problemex\sample.csv"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Nov 2014 09:38:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-in-import-csv-file/m-p/168991#M43703</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2014-11-13T09:38:46Z</dc:date>
    </item>
  </channel>
</rss>

