<?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 with importing csv file in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Problem-with-importing-csv-file/m-p/441957#M4772</link>
    <description>&lt;P&gt;How are you importing your data? Did you specify FIRSTOBS=2 to avoid the header row?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/195111"&gt;@luigipugliese&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Dear all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I read the CSV&amp;nbsp;file as text in SAS Studio, I notice that the first row, which is the variables names, extend to the second row of my file. As a result, I am getting no rows when I tried to create a table for SAS. Can you help on how to resolve this problem?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Mar 2018 22:59:43 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-03-02T22:59:43Z</dc:date>
    <item>
      <title>Problem with importing csv file</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Problem-with-importing-csv-file/m-p/441945#M4771</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I read the CSV&amp;nbsp;file as text in SAS Studio, I notice that the first row, which is the variables names, extend to the second row of my file. As a result, I am getting no rows when I tried to create a table for SAS. Can you help on how to resolve this problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Mar 2018 22:18:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Problem-with-importing-csv-file/m-p/441945#M4771</guid>
      <dc:creator>luigipugliese</dc:creator>
      <dc:date>2018-03-02T22:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with importing csv file</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Problem-with-importing-csv-file/m-p/441957#M4772</link>
      <description>&lt;P&gt;How are you importing your data? Did you specify FIRSTOBS=2 to avoid the header row?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/195111"&gt;@luigipugliese&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Dear all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I read the CSV&amp;nbsp;file as text in SAS Studio, I notice that the first row, which is the variables names, extend to the second row of my file. As a result, I am getting no rows when I tried to create a table for SAS. Can you help on how to resolve this problem?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Mar 2018 22:59:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Problem-with-importing-csv-file/m-p/441957#M4772</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-02T22:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with importing csv file</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Problem-with-importing-csv-file/m-p/441964#M4774</link>
      <description>&lt;P&gt;Look at the file in a text editor such as&amp;nbsp; Wordpad, Notepad or even the SAS editor. Are there two lines of headers there?&lt;/P&gt;
&lt;P&gt;If so you may need to tell SAS to start reading data at the third row and your header information for variable names may need some adjustment. Either edit the text file so the headers are not on two lines or use one of the SAS tools to rename the variables after the data is imported.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect your data may have originated in a spread sheet where either the headers were in two cells or one of the headers had a line feed in it to make a stacked cell.&lt;/P&gt;
&lt;P&gt;If you data looks something like this (note the comma on the first line in the first position) your data likely had a two-cell header&lt;/P&gt;
&lt;PRE&gt;,Two cell,
id ,Header,other value
123,456,789&lt;/PRE&gt;
&lt;P&gt;If that is the case then one option is the edit the CSV so the header is corrected such as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;id ,Two cell Header,other value
123,456,789&lt;/PRE&gt;
&lt;P&gt;and import the corrected file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the file looks like this then a line feed was inserted into a cell.&lt;/P&gt;
&lt;PRE&gt;id ,Stacked
 Header,other value
123,456,789&lt;/PRE&gt;
&lt;P&gt;edit by backspacing at the first column in the second line to get&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;id ,Stacked Header,other value
123,456,789
&lt;/PRE&gt;
&lt;P&gt;and then import.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If neither of these matches you problem then copy the first three lines of the data from a text editor such as Notepad (definitely not Excel) and paste into a code box opened using the {I} icon on the forum message window header row so we can see what may be going on.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Mar 2018 23:44:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Problem-with-importing-csv-file/m-p/441964#M4774</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-03-02T23:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with importing csv file</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Problem-with-importing-csv-file/m-p/441977#M4776</link>
      <description>&lt;P&gt;Thank you for your inputs, but I am stil&amp;nbsp;having the same problem. So my csv&amp;nbsp;file looks like this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;especialidad,edad,sexo,reserva_mes_d,reserva_dia_d,reserva_hora_d,creacion_mes_d,&lt;/P&gt;&lt;P&gt;creacion_dia_d,creacion_hora_d,latencia,canal,tipo,show&lt;/P&gt;&lt;P&gt;76,66,1,1,1,18,12,4,14,18,1,1,0&lt;/P&gt;&lt;P&gt;76,66,1,1,1,19,12,5,11,17,1,1,0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2018-03-02 at 7.18.01 PM.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18944i81C3C92BD144563B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2018-03-02 at 7.18.01 PM.png" alt="Screen Shot 2018-03-02 at 7.18.01 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Mar 2018 00:22:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Problem-with-importing-csv-file/m-p/441977#M4776</guid>
      <dc:creator>luigipugliese</dc:creator>
      <dc:date>2018-03-03T00:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with importing csv file</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Problem-with-importing-csv-file/m-p/441978#M4777</link>
      <description>&lt;P&gt;I could resolve the issue by uploading it as a&amp;nbsp; .xls&amp;nbsp;file but not as a csv&amp;nbsp;file. Thank you so much tho for everything.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Mar 2018 00:24:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Problem-with-importing-csv-file/m-p/441978#M4777</guid>
      <dc:creator>luigipugliese</dc:creator>
      <dc:date>2018-03-03T00:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with importing csv file</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Problem-with-importing-csv-file/m-p/442423#M4814</link>
      <description>&lt;P&gt;Upload such things as a simple TXT file.&lt;/P&gt;
&lt;P&gt;Or simply from a TEXT editor copy and paste into the Codebox I mentioned previously the first 3 or 4 lines of data. The code box is important as the main message windows will reformat pasted text and do not actually represent your CSV file anymore.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you try going to the end of the first line and deleting the last character? That should have all of the header on one row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What code did you use: show the LOG.&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;</description>
      <pubDate>Mon, 05 Mar 2018 17:00:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Problem-with-importing-csv-file/m-p/442423#M4814</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-03-05T17:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with importing csv file</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Problem-with-importing-csv-file/m-p/442440#M4815</link>
      <description>&lt;P&gt;For such a simple file do NOT use proc import.&amp;nbsp; Just read it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
  infile 'myfilename' dsd truncover firstobs=3;
  input especialidad edad sexo 
        reserva_mes_d reserva_dia_d reserva_hora_d 
        creacion_mes_d creacion_dia_d creacion_hora_d 
        latencia canal tipo show
  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;If it turns out that by starting on line 3 you are missing the first row of actual data then your header line was not actually wrapped onto two lines in your file.&amp;nbsp; It just looked that way because it was longer than the screen you where using to view it.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 17:58:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Problem-with-importing-csv-file/m-p/442440#M4815</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-03-05T17:58:07Z</dc:date>
    </item>
  </channel>
</rss>

