<?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 a csv file with contains a variable with a long string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Importing-a-csv-file-with-contains-a-variable-with-a-long-string/m-p/482998#M125197</link>
    <description>&lt;P&gt;Your sample does not show a csv file, as a csv file is text with the columns separated by commas. Please post an actual sample of the csv as attachment or into a {i} window.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that you have commas &lt;EM&gt;and&lt;/EM&gt; quotes in your texts, so this will make it very hard for SAS to make any sense out of it.&lt;/P&gt;
&lt;P&gt;I strongly recommend to not use proc import for data like this, but roll your own data step. We may be able to help you once we have a good example of your input data.&lt;/P&gt;</description>
    <pubDate>Wed, 01 Aug 2018 06:46:23 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-08-01T06:46:23Z</dc:date>
    <item>
      <title>Importing a csv file with contains a variable with a long string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-a-csv-file-with-contains-a-variable-with-a-long-string/m-p/482993#M125194</link>
      <description>&lt;P&gt;I am using SAS&amp;nbsp;on demand for academics and want to import a CSV&amp;nbsp;file with 200 variables and 350 observations.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I imported by using the code -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename tiger '/home/user/username/State.csv';&lt;BR /&gt;Proc Import datafile= tiger DBMS = csv OUT=libname.Statea ;&lt;BR /&gt;GUESSINGROWS= All;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A sample&amp;nbsp;of the csv&amp;nbsp;is -&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;The career services office was not very helpful. I talked with them a few timesdo, not for those who want because all they did was tell me stuff I already knew and then said "you know what you want, now just go find it." I would have thought that they would be more helpful in actually finding a job. help actually finding a job. and then gave up They seem to be an office for those who have no idea what they want to&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when the csv&amp;nbsp;file was read in sas&amp;nbsp;the contents of the third column extended to the other columns - just as -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;The career services office was not very helpful. I talked with them a few&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;timesdo, not for those who&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;stuff I already knew and then&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;said&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;"you know w&lt;/TD&gt;&lt;TD&gt;T&amp;nbsp;want because all they did was tell me hat you want, now just go find it." I would have thought that they would be more helpful in actually finding a job. help actually finding a job. and then gave up They seem to be an office for those who have no idea what they want to&amp;nbsp;&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;P&gt;Can someone please suggest how to read the CSV&amp;nbsp;file in sas&amp;nbsp;using "SAS&amp;nbsp;on demand for academics" having a variable with a long string as shown above.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 06:19:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-a-csv-file-with-contains-a-variable-with-a-long-string/m-p/482993#M125194</guid>
      <dc:creator>75063</dc:creator>
      <dc:date>2018-08-01T06:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: Importing a csv file with contains a variable with a long string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-a-csv-file-with-contains-a-variable-with-a-long-string/m-p/482997#M125196</link>
      <description>&lt;P&gt;This does not look like a csv-file! Please open the file with a text editor and post some lines using "insert sas code" or the {i}-icon&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="grafik.png" style="width: 127px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21688iFF67361C1D1625FB/image-size/large?v=v2&amp;amp;px=999" role="button" title="grafik.png" alt="grafik.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 06:42:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-a-csv-file-with-contains-a-variable-with-a-long-string/m-p/482997#M125196</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2018-08-01T06:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: Importing a csv file with contains a variable with a long string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-a-csv-file-with-contains-a-variable-with-a-long-string/m-p/482998#M125197</link>
      <description>&lt;P&gt;Your sample does not show a csv file, as a csv file is text with the columns separated by commas. Please post an actual sample of the csv as attachment or into a {i} window.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that you have commas &lt;EM&gt;and&lt;/EM&gt; quotes in your texts, so this will make it very hard for SAS to make any sense out of it.&lt;/P&gt;
&lt;P&gt;I strongly recommend to not use proc import for data like this, but roll your own data step. We may be able to help you once we have a good example of your input data.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 06:46:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-a-csv-file-with-contains-a-variable-with-a-long-string/m-p/482998#M125197</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-01T06:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Importing a csv file with contains a variable with a long string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-a-csv-file-with-contains-a-variable-with-a-long-string/m-p/482999#M125198</link>
      <description>The original file was an xlsx file which I saved as a CSV file. The issue&lt;BR /&gt;that i am facing is that the long string is being read into multiple&lt;BR /&gt;observation leading to erroneous results&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Aug 2018 06:49:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-a-csv-file-with-contains-a-variable-with-a-long-string/m-p/482999#M125198</guid>
      <dc:creator>75063</dc:creator>
      <dc:date>2018-08-01T06:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Importing a csv file with contains a variable with a long string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-a-csv-file-with-contains-a-variable-with-a-long-string/m-p/483000#M125199</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/148556"&gt;@75063&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;The original file was an xlsx file which I saved as a CSV file. The issue&lt;BR /&gt;that i am facing is that the long string is being read into multiple&lt;BR /&gt;observation leading to erroneous results&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;OK, and where is the example? We can't help you without actual data to test code against.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 06:52:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-a-csv-file-with-contains-a-variable-with-a-long-string/m-p/483000#M125199</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-01T06:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Importing a csv file with contains a variable with a long string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-a-csv-file-with-contains-a-variable-with-a-long-string/m-p/483014#M125202</link>
      <description>&lt;P&gt;Whilst I agree with all posted before, and that what is posted is not sufficient to really post any further help, I would also ask, what do you intend to do with this data?&amp;nbsp; A big block of text is pretty much useless to anyone, next to impossible to process in any meaningful way.&amp;nbsp; So maybe just drop it?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 08:01:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-a-csv-file-with-contains-a-variable-with-a-long-string/m-p/483014#M125202</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-08-01T08:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Importing a csv file with contains a variable with a long string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-a-csv-file-with-contains-a-variable-with-a-long-string/m-p/483083#M125231</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/148556"&gt;@75063&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;The original file was an xlsx file which I saved as a CSV file. The issue&lt;BR /&gt;that i am facing is that the long string is being read into multiple&lt;BR /&gt;observation leading to erroneous results&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If at all practical I would see if this Excel file was exported from some other application. If so, see if that source could create a delimited file other than comma, perhaps a pipe character, |,&amp;nbsp; and import that. The mixture of quotes and commas imbedded in your text makes this a very poor candidate for CSV.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or perhaps save as simple open xml and use the SAS XML mapper to attempt to read the file.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 14:58:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-a-csv-file-with-contains-a-variable-with-a-long-string/m-p/483083#M125231</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-01T14:58:08Z</dc:date>
    </item>
  </channel>
</rss>

