<?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: Handling Line breaks in csv in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Handling-Line-breaks-in-csv/m-p/112923#M23305</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would use dlm = '09'x if the file were tab delimited.&amp;nbsp; If the file is comma delimited use the comma only.&lt;/P&gt;&lt;P&gt;Line breaks at end of data lines are normal for Windows and Unix&lt;/P&gt;&lt;P&gt;I have not had time to test it, but changing MISSOVER to FLOWOVER might work if SAS is detecting multiple line breaks&lt;/P&gt;&lt;P&gt;Can you post some sample lines where you have the problem?&lt;/P&gt;&lt;P&gt;Also, which operating system are you working in and was the data copied from another system.&lt;/P&gt;&lt;P&gt;Does your data have headers?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard in Oz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 Oct 2012 08:45:50 GMT</pubDate>
    <dc:creator>RichardinOz</dc:creator>
    <dc:date>2012-10-31T08:45:50Z</dc:date>
    <item>
      <title>Handling Line breaks in csv</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-Line-breaks-in-csv/m-p/112922#M23304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0px 0px 0.5em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"&gt;Hi All,&lt;/P&gt;&lt;P style="margin: 0px 0px 0.5em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"&gt;&lt;/P&gt;&lt;P style="margin: 0px 0px 0.5em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"&gt;I want to import a csv file in SAS.&lt;/P&gt;&lt;P style="margin: 0px 0px 0.5em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"&gt;The problem is that, it contains line breaks and it is causing errors.&lt;/P&gt;&lt;P style="margin: 0px 0px 0.5em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"&gt;My question is, can we use dlm = '09'x and dlm = ',' together in one statement?&lt;/P&gt;&lt;P style="margin: 0px 0px 0.5em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"&gt;&lt;/P&gt;&lt;P style="margin: 0px 0px 0.5em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"&gt;Like this:&lt;/P&gt;&lt;P style="margin: 0px 0px 0.5em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"&gt; infile &amp;amp;file12 dlm='09'x dlm = ',' MISSOVER DSD ;&lt;/P&gt;&lt;P style="margin: 0px 0px 0.5em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"&gt;(I have given a macro for file name which is working perfectly fine)&lt;/P&gt;&lt;P style="margin: 0px 0px 0.5em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"&gt;&lt;/P&gt;&lt;P style="margin: 0px 0px 0.5em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"&gt;Kindly suggest.&lt;/P&gt;&lt;P style="margin: 0px 0px 0.5em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"&gt;&lt;/P&gt;&lt;P style="margin: 0px 0px 0.5em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"&gt;Thanks &amp;amp; regards,&lt;/P&gt;&lt;P style="margin: 0px 0px 0.5em; color: #000000; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;"&gt;Shaheen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Oct 2012 08:07:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-Line-breaks-in-csv/m-p/112922#M23304</guid>
      <dc:creator>ShaheenRanalvi</dc:creator>
      <dc:date>2012-10-31T08:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Line breaks in csv</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-Line-breaks-in-csv/m-p/112923#M23305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would use dlm = '09'x if the file were tab delimited.&amp;nbsp; If the file is comma delimited use the comma only.&lt;/P&gt;&lt;P&gt;Line breaks at end of data lines are normal for Windows and Unix&lt;/P&gt;&lt;P&gt;I have not had time to test it, but changing MISSOVER to FLOWOVER might work if SAS is detecting multiple line breaks&lt;/P&gt;&lt;P&gt;Can you post some sample lines where you have the problem?&lt;/P&gt;&lt;P&gt;Also, which operating system are you working in and was the data copied from another system.&lt;/P&gt;&lt;P&gt;Does your data have headers?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard in Oz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Oct 2012 08:45:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-Line-breaks-in-csv/m-p/112923#M23305</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2012-10-31T08:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Line breaks in csv</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-Line-breaks-in-csv/m-p/112924#M23306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your data has blank lines like the test set below this fix might work for you.&amp;nbsp; Note use of FLOWOVER &lt;EM&gt;and &lt;/EM&gt;no DSD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1, 2, 3&lt;/P&gt;&lt;P&gt;4, 5, 6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7, 8, 9&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile 'C:\Users\Public\Temp\test.txt' dlm=',' FLOWOVER ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input A B C ;&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: The file 'C:\Users\Public\Temp\test.txt' is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; File Name 'C:\Users\Public\Temp\test.txt',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Lrecl=256, Recfm=V&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: 4 records were read from file 'C:\Users\Public\Temp\test.txt'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The minimum record length was 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The maximum record length was 7&lt;/P&gt;&lt;P&gt;NOTE: A new line was read when INPUT statement read past the end of a line&lt;/P&gt;&lt;P&gt;NOTE: Data set "WORK.test" has 3 observation(s) and 3 variable(s)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Oct 2012 09:02:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-Line-breaks-in-csv/m-p/112924#M23306</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2012-10-31T09:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Line breaks in csv</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-Line-breaks-in-csv/m-p/112925#M23307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to more specific about "line breaks". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my limited experience CSVs created by XL can have '0A'x as a result of the use of alt-enter in XL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should be able to use the INFILE statement option TERMSTR=CRLF which "should" fix the problem. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are still using SAS 9.1 I don't this this worked in that version of SAS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Oct 2012 11:16:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-Line-breaks-in-csv/m-p/112925#M23307</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-10-31T11:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Line breaks in csv</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-Line-breaks-in-csv/m-p/112926#M23308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are two ways :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;infile datalines dlm='2C09'x&amp;nbsp; MISSOVER DSD;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2C is hex value of comma ,or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;infile datalines dlm=', ' expandtabs;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2012 04:05:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-Line-breaks-in-csv/m-p/112926#M23308</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-11-01T04:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Line breaks in csv</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Handling-Line-breaks-in-csv/m-p/426988#M105260</link>
      <description>&lt;P&gt;I had a similar problem.&lt;/P&gt;&lt;P&gt;My data was a free text survey data and was in CSV format(comma delimited).&lt;/P&gt;&lt;P&gt;Changing &lt;STRONG&gt;MISSOVER&lt;/STRONG&gt; to &lt;STRONG&gt;FLOWOVER&lt;/STRONG&gt; did the trick.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks everyone&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 20:10:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Handling-Line-breaks-in-csv/m-p/426988#M105260</guid>
      <dc:creator>anujyadav7547</dc:creator>
      <dc:date>2018-01-11T20:10:18Z</dc:date>
    </item>
  </channel>
</rss>

