<?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: proc import failing, maybe because of line breaks in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-import-failing-maybe-because-of-line-breaks/m-p/751618#M236629</link>
    <description>&lt;P&gt;The input statement does not match the data, try adding statement&lt;/P&gt;
&lt;PRE class="sas"&gt;guessingrows=&lt;SPAN&gt;max&lt;/SPAN&gt;;&lt;/PRE&gt;
&lt;P&gt;to help SAS better parse the lengths.&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jul 2021 04:52:26 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2021-07-02T04:52:26Z</dc:date>
    <item>
      <title>proc import failing, maybe because of line breaks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-failing-maybe-because-of-line-breaks/m-p/751490#M236572</link>
      <description>&lt;P&gt;I am trying to load in a fairly large dataset in which there are line breaks in some rows. This data is fine to view in the csv and can be loaded into R very easily.&lt;/P&gt;
&lt;P&gt;How can I get the data loaded in properly?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc import
datafile="C:/Users/bbgeoa/Documents/My SAS Files/ALLjune20-may21.csv" 
out= tm.procimport dbms = csv replace;
getnames=yes;
run;&lt;/PRE&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;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Jul 2021 07:13:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-failing-maybe-because-of-line-breaks/m-p/751490#M236572</guid>
      <dc:creator>sasprogramming</dc:creator>
      <dc:date>2021-07-21T07:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: proc import failing, maybe because of line breaks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-failing-maybe-because-of-line-breaks/m-p/751618#M236629</link>
      <description>&lt;P&gt;The input statement does not match the data, try adding statement&lt;/P&gt;
&lt;PRE class="sas"&gt;guessingrows=&lt;SPAN&gt;max&lt;/SPAN&gt;;&lt;/PRE&gt;
&lt;P&gt;to help SAS better parse the lengths.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 04:52:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-failing-maybe-because-of-line-breaks/m-p/751618#M236629</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-07-02T04:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: proc import failing, maybe because of line breaks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-failing-maybe-because-of-line-breaks/m-p/751740#M236685</link>
      <description>And make sure "ALLjune20-may21.csv" is created under Windows, if your sas is running under Windows .&lt;BR /&gt;Otherwise, you need change end-of-line character like :&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;filename x 'c:\temp\ALLjune20-may21.csv' termstr=lf;&lt;BR /&gt;proc import datafile=x ............&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;OR&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;filename x 'c:\temp\ALLjune20-may21.csv' termstr=crlf;&lt;BR /&gt;proc import datafile=x ............</description>
      <pubDate>Fri, 02 Jul 2021 14:08:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-failing-maybe-because-of-line-breaks/m-p/751740#M236685</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-07-02T14:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: proc import failing, maybe because of line breaks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-failing-maybe-because-of-line-breaks/m-p/751945#M236794</link>
      <description>&lt;P&gt;Doesn't fix the problem, not sure why SAS struggles so hard in reading in data when compared to R/Python&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jul 2021 05:09:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-failing-maybe-because-of-line-breaks/m-p/751945#M236794</guid>
      <dc:creator>sasprogramming</dc:creator>
      <dc:date>2021-07-04T05:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: proc import failing, maybe because of line breaks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-failing-maybe-because-of-line-breaks/m-p/751946#M236795</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/302184"&gt;@sasprogramming&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This looks like real unmasked data. I STRONGLY recommend that you remove anything PII from this post asap.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jul 2021 07:01:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-failing-maybe-because-of-line-breaks/m-p/751946#M236795</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-07-04T07:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: proc import failing, maybe because of line breaks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-failing-maybe-because-of-line-breaks/m-p/751956#M236802</link>
      <description>&lt;P&gt;It was sample data&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jul 2021 09:08:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-failing-maybe-because-of-line-breaks/m-p/751956#M236802</guid>
      <dc:creator>sasprogramming</dc:creator>
      <dc:date>2021-07-04T09:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: proc import failing, maybe because of line breaks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-failing-maybe-because-of-line-breaks/m-p/751957#M236803</link>
      <description>You may be lucky if the unwanted line breaks in text are just CR or LF, while the "real" line breaks are CRLF (or the other way round); in this case, the TERMSTR= option will bail you out.&lt;BR /&gt;It is along on-going issue with SAS that line breaks in variables are not recognized as "invalid".&lt;BR /&gt;Even a well-supported Ballot Idea has been rejected by SAS, which is considered a severe insult by many of the senior members here.</description>
      <pubDate>Sun, 04 Jul 2021 09:20:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-failing-maybe-because-of-line-breaks/m-p/751957#M236803</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-07-04T09:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: proc import failing, maybe because of line breaks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-failing-maybe-because-of-line-breaks/m-p/751958#M236804</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/302184"&gt;@sasprogramming&lt;/a&gt;&amp;nbsp;That's very comforting to know given that there was a real company name and account numbers in it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Suggest you follow the advice already given:&lt;BR /&gt;- guessingrows=max;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;This so SAS first scans the whole source file and then creates variable types and lengths suitable for all of the data.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- TERMSTR=CRLF&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;I normally use Notepad++ to investigate a text file and select&amp;nbsp;&lt;EM&gt;view/show symbols/show all characters -&amp;nbsp;&lt;/EM&gt;this will tell you what you're dealing with.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- options validvarname=v7;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;This so the SAS variable names created comply with SAS naming standards. Any non-compliant character like a blank will get replaced with an underscore.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jul 2021 09:31:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-failing-maybe-because-of-line-breaks/m-p/751958#M236804</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-07-04T09:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: proc import failing, maybe because of line breaks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-failing-maybe-because-of-line-breaks/m-p/751959#M236805</link>
      <description>&lt;P&gt;PS I was talking about this Ballot entry:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SASware-Ballot-Ideas/Enhancements-to-INFILE-FILE-to-handle-delimited-file-variations/idi-p/435977" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SASware-Ballot-Ideas/Enhancements-to-INFILE-FILE-to-handle-delimited-file-variations/idi-p/435977&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jul 2021 09:46:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-failing-maybe-because-of-line-breaks/m-p/751959#M236805</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-07-04T09:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: proc import failing, maybe because of line breaks</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-import-failing-maybe-because-of-line-breaks/m-p/752027#M236827</link>
      <description>Can you post some data of "ALLjune20-may21.csv" ?&lt;BR /&gt;So we can test it and find out where is the problem .</description>
      <pubDate>Mon, 05 Jul 2021 07:54:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-import-failing-maybe-because-of-line-breaks/m-p/752027#M236827</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-07-05T07:54:44Z</dc:date>
    </item>
  </channel>
</rss>

