<?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 data stops SAS in the middle of a textfile without generating an error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/importing-data-stops-SAS-in-the-middle-of-a-textfile-without/m-p/652846#M196073</link>
    <description>&lt;P&gt;Indeed, the option IGNOREDOSEOF did the trick.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much.&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jun 2020 12:50:26 GMT</pubDate>
    <dc:creator>fre</dc:creator>
    <dc:date>2020-06-03T12:50:26Z</dc:date>
    <item>
      <title>importing data stops SAS in the middle of a textfile without generating an error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/importing-data-stops-SAS-in-the-middle-of-a-textfile-without/m-p/652791#M196039</link>
      <description>&lt;P&gt;Dear community,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm using this code to import a specific textfile - which worked very well for years: (it's part of a macro)&lt;/P&gt;
&lt;PRE&gt;		data WORK.ONE_FILE ;

		%let _EFIERR_ = 0; /* set the ERROR detection macro variable */
		infile "&amp;amp;path_in.&amp;amp;&amp;amp;bestand&amp;amp;ii."
		delimiter='09'x MISSOVER DSD lrecl=32767 firstobs=2 ;
	
		informat var1 best12. ;
		informat var2 best12.;
		
		/* informat var3, var4, etc... */
	
		format var1 best12.;
		format var2 best12. ;

		/* format var3, var4, etc... */
		
		input
		var1
		var2

		/* input var3, var4, etc... */
		;
		
		if _ERROR_ then call symputx('_EFIERR_',1);  /* set ERROR detection macro variable */

		run;
&lt;/PRE&gt;
&lt;P&gt;With my last textfile, there was a problem:&amp;nbsp; SAS stopped importing after 3.000 lines, while there are 20.000 lines in the textfile, &lt;STRONG&gt;and SAS did not generate an error in the log. &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After looking into the textfile, I saw the problem.&amp;nbsp; There was a weird character in the textfile.&amp;nbsp; I've made two screenshots (attached to this post).&amp;nbsp; One taken from notepad and one taken from notepad++.&lt;/P&gt;
&lt;P&gt;The weird character is visualized different in those 2 screenshots.&lt;/P&gt;
&lt;P&gt;(i've saved the screenshot in a worddoc because this forum doesn't allow jpg-files)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My question is:&amp;nbsp; is there a way that I can adapt my code so that SAS will import the whole textfile (and not stopping after 3000 lines), so basically that SAS ignores that weird character?&lt;/P&gt;
&lt;P&gt;Or at least that it generates an error when it encounters such weird characters (and not stopping without warning)?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 09:17:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/importing-data-stops-SAS-in-the-middle-of-a-textfile-without/m-p/652791#M196039</guid>
      <dc:creator>fre</dc:creator>
      <dc:date>2020-06-03T09:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: importing data stops SAS in the middle of a textfile without generating an error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/importing-data-stops-SAS-in-the-middle-of-a-textfile-without/m-p/652816#M196057</link>
      <description>What character set is SAS running?   (You can see this from the SAS encoding option).&lt;BR /&gt; Is the file in the same character set?   (Notepad ++ can help you to determine that)&lt;BR /&gt;&lt;BR /&gt;I have an idea for a fix, but would like to test it before posting.  What is the hex value of the offending character? (Notepad ++ can show that).&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Jun 2020 11:09:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/importing-data-stops-SAS-in-the-middle-of-a-textfile-without/m-p/652816#M196057</guid>
      <dc:creator>DavePrinsloo</dc:creator>
      <dc:date>2020-06-03T11:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: importing data stops SAS in the middle of a textfile without generating an error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/importing-data-stops-SAS-in-the-middle-of-a-textfile-without/m-p/652837#M196068</link>
      <description>&lt;P&gt;Hi Dave, thank you for your reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the SAS log, I can see ENCODING = UTF8&lt;/P&gt;
&lt;P&gt;In Notepad++, I can see this matches (also UTF-8).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I didn't find the option to view the hex value, I've attached the piece of text that contains this weird character, hopefully you can see the hex value this way.&amp;nbsp;&amp;nbsp; It has to be an accent or something like that, I guess.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 12:02:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/importing-data-stops-SAS-in-the-middle-of-a-textfile-without/m-p/652837#M196068</guid>
      <dc:creator>fre</dc:creator>
      <dc:date>2020-06-03T12:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: importing data stops SAS in the middle of a textfile without generating an error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/importing-data-stops-SAS-in-the-middle-of-a-textfile-without/m-p/652842#M196071</link>
      <description>&lt;P&gt;Try adding the IGNOREDOSEOF option to the INFILE statement.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/proc-import-reads-only-678-obs-from-csv-file/td-p/142741" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/proc-import-reads-only-678-obs-from-csv-file/td-p/142741&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 12:25:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/importing-data-stops-SAS-in-the-middle-of-a-textfile-without/m-p/652842#M196071</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-06-03T12:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: importing data stops SAS in the middle of a textfile without generating an error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/importing-data-stops-SAS-in-the-middle-of-a-textfile-without/m-p/652846#M196073</link>
      <description>&lt;P&gt;Indeed, the option IGNOREDOSEOF did the trick.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 12:50:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/importing-data-stops-SAS-in-the-middle-of-a-textfile-without/m-p/652846#M196073</guid>
      <dc:creator>fre</dc:creator>
      <dc:date>2020-06-03T12:50:26Z</dc:date>
    </item>
  </channel>
</rss>

