<?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: Import issue:  Invalid string - Unrecoverable I/O error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517664#M140015</link>
    <description>I fixed them - Sorry about that</description>
    <pubDate>Fri, 30 Nov 2018 21:02:17 GMT</pubDate>
    <dc:creator>AMSAS</dc:creator>
    <dc:date>2018-11-30T21:02:17Z</dc:date>
    <item>
      <title>Import issue:  Invalid string - Unrecoverable I/O error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517562#M139974</link>
      <description>&lt;P&gt;I'm importing a large file of "search term" strings that users entered into our website, and I got a fatal error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7"&gt;&lt;STRONG&gt;ERROR: Invalid string.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7"&gt; &lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FATAL: Unrecoverable I/O error detected in the execution of the DATA step program. Aborted during the EXECUTION phase.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7"&gt; &lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NOTE: 190 records were read from the infile "/sasem/gbmkuser/search/2Q_2018_Report.csv".&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" size="1 2 3 4 5 6 7"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;After the first run, I deleted a LOT of old data, and ran it again (in case the I/O error was being caused by a shortage of space), but I got the same error on the second run (and had 10 times more free space than the size of the file for that run).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm an employee using SAS EG, so I'm not really sure how much control I have on changing import settings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;My DATA step is below. I'm hoping that someone can help me change it to solve this issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks so much!&amp;nbsp; Barb&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;data search.file_2Q_2018_Report;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile "&amp;amp;filepath/2Q_2018_Report.csv"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delimiter = ',' MISSOVER DSD lrecl=2000 firstobs=2 ;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format&amp;nbsp; search_term_orig $200.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_success comma10.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_fail comma10.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_total comma10.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input&amp;nbsp;&amp;nbsp; search_term_orig&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_success&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_fail&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count_total = sum(count_success, count_fail);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 16:42:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517562#M139974</guid>
      <dc:creator>BRKS</dc:creator>
      <dc:date>2018-11-30T16:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Import issue:  Invalid string - Unrecoverable I/O error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517605#M139987</link>
      <description>&lt;P&gt;Hi Barb&lt;BR /&gt;&lt;BR /&gt;The first thing I would suggest is to run it against a really small input file or a smaller sample of the file you are reading. I see you are already using the FIRSTOBS option, you could add the OBS option and set it to 100. Then run your code and see if that works (I suspect it will).&lt;BR /&gt;&lt;BR /&gt;Next, I'd set OBS to half the number of rows in the input data and see if that runs (e.g. 1M rows in source file, set Obs=500000)&lt;BR /&gt;&lt;BR /&gt;If that runs, then change FIRSTOBS to 500000 and remove or set OBS=MAX&lt;BR /&gt;&lt;BR /&gt;I suspect there is&amp;nbsp;something "odd" about the source data that may be causing the issue.&lt;BR /&gt;&lt;BR /&gt;Andy&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 18:36:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517605#M139987</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2018-11-30T18:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Import issue:  Invalid string - Unrecoverable I/O error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517607#M139988</link>
      <description>I'd do this:&lt;BR /&gt;&lt;BR /&gt;PROC IMPORT OUT=search.file_2Q_2018_Report &lt;BR /&gt;REPLACE&lt;BR /&gt;DATAFILE="&amp;amp;filepath/2Q_2018_Report.csv"&lt;BR /&gt;DBMS=csv; &lt;BR /&gt;GUESSINGROWS=100000&lt;BR /&gt;;&lt;BR /&gt;run;</description>
      <pubDate>Fri, 30 Nov 2018 18:38:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517607#M139988</guid>
      <dc:creator>tomrvincent</dc:creator>
      <dc:date>2018-11-30T18:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: Import issue:  Invalid string - Unrecoverable I/O error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517617#M139993</link>
      <description>Hi Andy - thanks so much.  I ran various obs amounts, and it looks like the issue is with record #191.  If I run anything from obs=190 or lower, it works.  If I run anything from obs=191 or higher, I get the failure.  What could I do to prevent that record from failing?  Thanks so much!</description>
      <pubDate>Fri, 30 Nov 2018 19:30:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517617#M139993</guid>
      <dc:creator>BRKS</dc:creator>
      <dc:date>2018-11-30T19:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Import issue:  Invalid string - Unrecoverable I/O error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517619#M139994</link>
      <description>Hi Tom,  Unfortunately I got the same error.  &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;  This is a tough one!</description>
      <pubDate>Fri, 30 Nov 2018 19:33:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517619#M139994</guid>
      <dc:creator>BRKS</dc:creator>
      <dc:date>2018-11-30T19:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: Import issue:  Invalid string - Unrecoverable I/O error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517626#M139998</link>
      <description>&lt;P&gt;As I was running the tests with the different number of observations, I noticed something in the log that had not caught my attention before:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier" color="#0000FF"&gt;NOTE: A byte-order mark in the file "/sasem/gbmkuser/search/troy_1Q_2018_Report.csv" (for fileref "#LN00062") indicates that the data is encoded in "utf-8". This encoding will be used to process the file. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I searched Google on this, I found a SAS page (&lt;A href="http://support.sas.com/kb/19/028.html" target="_blank"&gt;http://support.sas.com/kb/19/028.html&lt;/A&gt;) that says: Unicode SAS with UTF-8 encoding uses 1 to 4 bytes to handle Unicode data. It is possible for the 8-bit characters to be expanded by 2 to 3 bytes when transcoding occurs, which causes the truncation error. You might not see these error messages with English SAS because the limitation is unique to Unicode SAS. There is no workaround for this issue. To avoid getting this error, do not use an external file that contains 8-bit characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't have any control over what users put into our search box. I'm assuming that one user put in something that looks like UTF-8, and another user put in something that was an 8-bit character. Seeing the comment "There is no workaround for this issue" is daunting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At this point, it looks like the file structure itself is okay, but there are characters &lt;U&gt;within&lt;/U&gt; the file that are causing problems for SAS. My questions are:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Is there a way to force the system to use a different encoding, instead of it automatically switching to that because of the contents of that record?&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;If I am able to force that switch, would it still fail with an I/O error because of the record that has the UTF-8 looking character?&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;Any other ideas how I can get SAS to work with this data?&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will add that one of my co-workers suggested that I bring the file into Excel, and save it as an Excel file. I gave this a try and it actually worked - Excel was able to open the file with no problem!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I used PROC IMPORT like Tom suggested on the Excel file, with the dbms=xlsx, and that worked!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So this solved today's problem, but I was lucky this time that the file only had 969k records. If it had been too much larger, I would not have been able to open the whole file in Excel.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's where I'm scratching my head, though...&amp;nbsp; Excel popped this file open in less than a minute, and it dealt with the characters in some way that cleansed them enough to get them into SAS. But it seems like if Excel can do it, then SAS should definitely be able to do it too. SAS is the tool I go to when nothing else works, and I've never found a problem I couldn't solve directly in SAS. So this is a little surprising to me that this&amp;nbsp;SAS issue&amp;nbsp;is being reported by SAS support as having&amp;nbsp;"no workaround".&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 19:55:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517626#M139998</guid>
      <dc:creator>BRKS</dc:creator>
      <dc:date>2018-11-30T19:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: Import issue:  Invalid string - Unrecoverable I/O error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517640#M140002</link>
      <description>You could write a macro loop that reads one line in at a time in various encodings and keep the successful rows.</description>
      <pubDate>Fri, 30 Nov 2018 20:18:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517640#M140002</guid>
      <dc:creator>tomrvincent</dc:creator>
      <dc:date>2018-11-30T20:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: Import issue:  Invalid string - Unrecoverable I/O error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517647#M140005</link>
      <description>&lt;P&gt;Here's a couple of other SAS Notes that may help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/38/696.html" target="_self"&gt;Usage Note 38696&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/13/727.html" target="_self"&gt;Usage Note&amp;nbsp;13727&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you are&amp;nbsp;on the right path with the comment &lt;BR /&gt;"&lt;SPAN&gt;&lt;EM&gt;I don't have any control over what users put into our search box. I'm assuming that one user put in something that looks like UTF-8, and another user put in something that was an 8-bit character. Seeing the comment "There is no workaround for this issue" is daunting.&lt;/EM&gt;"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If those notes don't help, then I suggest you open a &lt;A href="https://support.sas.com/ctx/supportform/createForm" target="_self"&gt;TS Track&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 21:01:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517647#M140005</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2018-11-30T21:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Import issue:  Invalid string - Unrecoverable I/O error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517650#M140007</link>
      <description>I'm not that smart, Tom!  &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;  &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;</description>
      <pubDate>Fri, 30 Nov 2018 20:38:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517650#M140007</guid>
      <dc:creator>BRKS</dc:creator>
      <dc:date>2018-11-30T20:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Import issue:  Invalid string - Unrecoverable I/O error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517652#M140008</link>
      <description>Thanks AMSAS!  when I click on those usage Note links, I get an error:&lt;BR /&gt;&lt;BR /&gt;This site can’t be reached soul2.unx.sas.com’s server IP address could not be found.&lt;BR /&gt;Search Google for soul 2 unx sas 8081 TESSA main My Note&lt;BR /&gt;ERR_NAME_NOT_RESOLVED&lt;BR /&gt;&lt;BR /&gt;Are they only accessible by SAS employees maybe?&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;Barb</description>
      <pubDate>Fri, 30 Nov 2018 20:41:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517652#M140008</guid>
      <dc:creator>BRKS</dc:creator>
      <dc:date>2018-11-30T20:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Import issue:  Invalid string - Unrecoverable I/O error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517658#M140012</link>
      <description>&lt;A href="http://support.sas.com/kb/38/696.html" target="_blank"&gt;http://support.sas.com/kb/38/696.html&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://support.sas.com/kb/13/727.html" target="_blank"&gt;http://support.sas.com/kb/13/727.html&lt;/A&gt;</description>
      <pubDate>Fri, 30 Nov 2018 20:46:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517658#M140012</guid>
      <dc:creator>tomrvincent</dc:creator>
      <dc:date>2018-11-30T20:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: Import issue:  Invalid string - Unrecoverable I/O error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517662#M140014</link>
      <description>Thanks Tom - That's what I get for trying to reply quickly, indeed I posted the internal SAS employee links</description>
      <pubDate>Fri, 30 Nov 2018 20:59:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517662#M140014</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2018-11-30T20:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Import issue:  Invalid string - Unrecoverable I/O error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517664#M140015</link>
      <description>I fixed them - Sorry about that</description>
      <pubDate>Fri, 30 Nov 2018 21:02:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517664#M140015</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2018-11-30T21:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: Import issue:  Invalid string - Unrecoverable I/O error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517931#M140097</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/56331"&gt;@BRKS&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From your description of the problem I conclude:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Your CSV file starts with a "byte-order mark" (BOM) -- probably 'EFBBBF'x -- indicating UTF-8 encoding. (I found this hex string in the document &lt;A href="http://www.unicode.org/faq/utf_bom.html#29." target="_blank"&gt;http://www.unicode.org/faq/utf_bom.html#29.&lt;/A&gt; linked in &lt;A href="http://support.sas.com/kb/13/727.html" target="_blank"&gt;http://support.sas.com/kb/13/727.html&lt;/A&gt;.)&lt;/LI&gt;
&lt;LI&gt;Line 191 of the CSV file contains a byte sequence that is "illegal" in UTF-8 encoding. According to the document mentioned above this might be a sequence of the form &amp;lt;110xxxxx&lt;I&gt;&lt;SUB&gt;2&lt;/SUB&gt;&lt;/I&gt; 0xxxxxxx&lt;I&gt;&lt;SUB&gt;2&lt;/SUB&gt;&lt;/I&gt;&amp;gt;.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;I was able to replicate the issue with a small file and then read it using a rudimentary workaround.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Create a test file (with SAS 9.4M5 on a Windows machine using WLATIN1 encoding) */

data _null_;
file 'C:\Temp\bomtst.csv' dsd;
set sashelp.prdsale(obs=3);
if _n_=1 then put 'EFBBBF'x @; /* BOM (byte-order mark) */
if _n_=2 then country='Ägypten'; /* "illegal" in UTF-8 */
if _n_=3 then country='C384'x||'gypten'; /* UTF-8 encoding */
put product country actual;
run;

/* Replicate the issue */

data test;
infile 'C:\Temp\bomtst.csv' dsd;
input (product country) (:$10.) actual :dollar.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Log:&lt;/P&gt;
&lt;PRE&gt;&lt;FONT color="#0000FF"&gt;NOTE: A byte-order mark in the file "C:\Temp\bomtst.csv" (for fileref "#LN00034") indicates that the data is encoded in "utf-8".  This encoding
      will be used to process the file.
NOTE: The infile 'C:\Temp\bomtst.csv' is:&lt;/FONT&gt;
(...)

&lt;FONT color="#FF0000"&gt;ERROR: Invalid string.
FATAL: Unrecoverable I/O error detected in the execution of the DATA step program.  Aborted during the EXECUTION phase.&lt;/FONT&gt;
&lt;FONT color="#0000FF"&gt;NOTE: 1 record was read from the infile 'C:\Temp\bomtst.csv'.
      The minimum record length was 19.
      The maximum record length was 19.
NOTE: The SAS System stopped processing this step because of errors.&lt;/FONT&gt;
&lt;FONT color="#008000"&gt;WARNING: The data set WORK.TEST may be incomplete.  When this step was stopped there were 1 observations and 3 variables.
&lt;/FONT&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Rudimentary workaround */

/* Step 1: Verify that BOM is present */

data _null_;
infile 'C:\Temp\bomtst.csv' recfm=N;
input c $char10.;
put c $hex20.;
stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Log:&lt;/P&gt;
&lt;PRE&gt;EFBBBF534F46412C4341&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Step 2: Create a copy of the CSV file with BOM removed */

data _null_;
infile 'C:\Temp\bomtst.csv' recfm=N;
file 'C:\Temp\nobomtst.csv' recfm=N;
if _n_=1 then input +3 @@; /* skip first three bytes (adapt if BOM is longer) */
input c $char1.;
put c $1.;
run;

/* Step 3: Read file without BOM and create a copy of the affected variable (here: COUNTRY),
           transcoded from UTF-8 to WLATIN1 (assuming this is the session encoding) */

data check(rename=(country=country_wlatin1));
length country_utf8 $10;
infile 'C:\Temp\nobomtst.csv' dsd;
input (product country) (:$10.) actual :dollar.;
country_utf8=kcvt(country, 'utf-8', 'wlatin1');
run;

proc print data=check(obs=3);
var product country_wlatin1 country_utf8 actual;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PROC PRINT output (screenshot to avoid more transcoding issues)&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="utf8.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25320i70909CABF18E5B56/image-size/large?v=v2&amp;amp;px=999" role="button" title="utf8.png" alt="utf8.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Now you could select observations with &lt;FONT face="courier new,courier"&gt;country_wlatin1 ne country_utf8&lt;/FONT&gt;&amp;nbsp;from dataset CHECK and look at some or all of them to make an informed decision on the appropriate handling of this variable.&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/56331"&gt;@BRKS&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I searched Google on this, I found a SAS page (&lt;A href="http://support.sas.com/kb/19/028.html" target="_blank"&gt;http://support.sas.com/kb/19/028.html&lt;/A&gt;) that says:&amp;nbsp;(...) There is no workaround for this issue.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(...)&lt;/P&gt;
&lt;P&gt;Excel was able to open the file with no problem!&lt;/P&gt;
&lt;P&gt;(...)&lt;/P&gt;
&lt;P&gt;But it seems like if Excel can do it, then SAS should definitely be able to do it too. SAS is the tool I go to when nothing else works, and I've never found a problem I couldn't solve directly in SAS. So this is a little surprising to me that this&amp;nbsp;SAS issue&amp;nbsp;is being reported by SAS support as having&amp;nbsp;"no workaround".&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I think you misunderstood that Problem Note 19028: It's about a problem that was reported&amp;nbsp;for SAS&amp;nbsp;release&amp;nbsp;&lt;SPAN&gt;9.1 TS1M3 SP4 and fixed (at least on most platforms) in&amp;nbsp;release&amp;nbsp;9.2 TS1M0 (see table "Operating System and Release Information"). Moreover, in the tab "Hot Fix" there are two links to hot fixes for the affected 9.1 release.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I fully agree that there must be a way to handle the situation with SAS and I would regard using Excel for this as "casting out devils by Beelzebub."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In the forum archives there are more discussions about this issue, e.g.:&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Invalid-string-Error-while-importing-a-file-which-contains/td-p/190226" target="_blank"&gt;Invalid string Error while importing a file which contains smiley symbols&lt;/A&gt;&amp;nbsp;(mentions the zip engine as a possible remedy)&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://communities.sas.com/t5/General-SAS-Programming/Changing-session-character-encoding-from-wlatin1-to-utf-8/m-p/218516" target="_blank"&gt;Changing session character encoding from wlatin1 to utf-8&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Sun, 02 Dec 2018 22:02:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/517931#M140097</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-12-02T22:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Import issue:  Invalid string - Unrecoverable I/O error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/859807#M339673</link>
      <description>&lt;P&gt;I just had this same error message and was able to track down the problem - in my dataset, there was an EMOJI in an open-text field. When I opened the CSV file in Excel I could see the silly thing... so annoyed that RedCap let that in. I don't know how one could possibly search for or tell SAS to screen them when reading in, but in case anyone has the same issue.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 02:15:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-issue-Invalid-string-Unrecoverable-I-O-error/m-p/859807#M339673</guid>
      <dc:creator>eschofie</dc:creator>
      <dc:date>2023-02-21T02:15:07Z</dc:date>
    </item>
  </channel>
</rss>

