<?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: Special Character in Log File Hindering Full Import in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Special-Character-in-Log-File-Hindering-Full-Import/m-p/981667#M379173</link>
    <description>&lt;P&gt;I looked at your example file and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt;&amp;nbsp;is correct that the end of file character is appearing in line(s) generated by the MLOGIC option.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  infile logfile truncover encoding='any'
%if "&amp;amp;SYSSCP"="WIN" %then %do; IGNOREDOSEOF %end;
  ;
  input;
  if verify(_infile_,collate(32,126)||'09'x||'0c'x) then list;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Notice that in addition to the FormFeed characters that SAS inserts to start each new page in the SAS log I had to also tell it to ignore TAB characters.&amp;nbsp; I looks like&amp;nbsp;your original program file had tab characters in it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should probably change your editor settings so that the tabs are replaces by spaces.&amp;nbsp; The tabs will not only cause trouble for people editing the program files they will cause you trouble when trying to analyze the dataset you created by reading in the LOG file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It also had another non-ASCII character being used in this statement.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile SASlist dlm="�";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You should probably replace that with a hex literal to avoid having issues when switching between character encodings.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile SASlist dlm="AC"x;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also I would not use PROC IMPORT to read in a CSV file, especially one where you expect it to have a specific format.&amp;nbsp; Just write the data step to read it yourself.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jan 2026 00:19:19 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2026-01-08T00:19:19Z</dc:date>
    <item>
      <title>Special Character in Log File Hindering Full Import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Special-Character-in-Log-File-Hindering-Full-Import/m-p/981654#M379166</link>
      <description>&lt;P&gt;My company utilizes PROC PRINTTO to send the log to a txt file.&amp;nbsp; We then import this txt file and search it for error/warning messages so we know if our program ran successfully.&amp;nbsp; We create another file that tells us if the log is clean or not so we know if it is reliable to proceed with reviewing the output.&amp;nbsp; I have noticed that the final log report occasionally tells me that there are no errors found, but the output seems off.&amp;nbsp; When I manually search the log for errors or warnings, I find some.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did some digging, but I realized that SAS is not importing the full log file.&amp;nbsp; The problem is that a greater than sign is getting translated into an arrow.&amp;nbsp; For some reason, SAS hits this arrow and stops importing.&amp;nbsp; I am wondering if anyone can help me understand why this is?&amp;nbsp; 1) Is there some kind of encoding option I can apply to allow SAS to recognize/bypass this character?&amp;nbsp; 2) Is there a reason SAS is translating "&amp;gt;" to "-&amp;gt;" in this one case but not anywhere else throughout the log?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is a snippet to import the log file of interest (note that I create a .log file normally, but I converted it to .txt so I could upload here).&amp;nbsp; Please note that there are 3287 lines in the file, but only 1969 are getting read in because that is where the arrow first appears.&amp;nbsp; Like I said, this arrow is replacing a greater than sign, but you can see in other places in the code that the symbol is displaying as expected (e.g., lines&amp;nbsp;1973, 1979, 1988).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename logfile "C:\ErrorWarningLogExample.txt";
data log;
	infile logfile length=linelen;
	input logline $varying200. linelen;
	logline=upcase(logline);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2026 20:04:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Special-Character-in-Log-File-Hindering-Full-Import/m-p/981654#M379166</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2026-01-07T20:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Special Character in Log File Hindering Full Import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Special-Character-in-Log-File-Hindering-Full-Import/m-p/981655#M379167</link>
      <description>&lt;P&gt;That SAS program in not going to modify any of the characters being read.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The most likely character that would cause that data step to TRUNCATE the input stream would be the Microsoft DOS End of File character.&amp;nbsp; There is an INFILE option you can use to prevent SAS from giving that character any special meaning.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/hostwin/chifoptfmain.htm" target="_self"&gt;Windows INFILE statement&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;H4 class="xisDoc-argument"&gt;IGNOREDOSEOF&lt;/H4&gt;
&lt;/BLOCKQUOTE&gt;
&lt;DIV class="xisDoc-argumentDescription"&gt;
&lt;BLOCKQUOTE&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;is used in the context of&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="xisDoc-nobr"&gt;I/O&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;operations on variable record format files. When this option is specified, any occurrence of ^Z is interpreted as character data and not as an end-of-file marker.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;Note also that your program is also going to truncate any lines that are longer than 200 bytes.&lt;/P&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;Try this program instead:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename logfile "C:\ErrorWarningLogExample.txt";
data log;
  infile logfile ignoredoseof truncover ;
  input logline $upcase200.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;PS I would not call what that program is doing IMPORT.&amp;nbsp; To me import implies converting data from some foreign format.&amp;nbsp; A text file is not some foreign format. This program is just READing in the file.&lt;/P&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 07 Jan 2026 20:24:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Special-Character-in-Log-File-Hindering-Full-Import/m-p/981655#M379167</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2026-01-07T20:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Special Character in Log File Hindering Full Import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Special-Character-in-Log-File-Hindering-Full-Import/m-p/981660#M379168</link>
      <description>&lt;P&gt;I think Tom is correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you view the file in Notepad++, you can see some of what look like control characters:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Quentin_0-1767819463841.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/112543i4A5D8A64D04ED031/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Quentin_0-1767819463841.png" alt="Quentin_0-1767819463841.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I see that you are using macro quoting:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;202        	%createcheck(chk=11, whr=%str(bmdtc&amp;gt;today()), keepvars=siteid subjid questid visit lbnam&lt;/PRE&gt;
&lt;P&gt;When you do that, SAS will temporarily convert the &amp;gt; sign into non-printable characters.&amp;nbsp; It looks like MLOGIC does not automatically unquote the value, so you are ending up with non-printable characters in your log file, and one of them gets interpreted as and end-of-file character.&amp;nbsp; That's quite a gotcha.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2026 21:02:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Special-Character-in-Log-File-Hindering-Full-Import/m-p/981660#M379168</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2026-01-07T21:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Special Character in Log File Hindering Full Import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Special-Character-in-Log-File-Hindering-Full-Import/m-p/981662#M379169</link>
      <description>Thank you so much!  The IGNOREDOSEOF seems to have worked.  I'll start applying this to all my other programs moving forward.  It makes me wonder how often my programs had issues that were never detected.</description>
      <pubDate>Wed, 07 Jan 2026 21:06:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Special-Character-in-Log-File-Hindering-Full-Import/m-p/981662#M379169</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2026-01-07T21:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Special Character in Log File Hindering Full Import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Special-Character-in-Log-File-Hindering-Full-Import/m-p/981667#M379173</link>
      <description>&lt;P&gt;I looked at your example file and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt;&amp;nbsp;is correct that the end of file character is appearing in line(s) generated by the MLOGIC option.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  infile logfile truncover encoding='any'
%if "&amp;amp;SYSSCP"="WIN" %then %do; IGNOREDOSEOF %end;
  ;
  input;
  if verify(_infile_,collate(32,126)||'09'x||'0c'x) then list;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Notice that in addition to the FormFeed characters that SAS inserts to start each new page in the SAS log I had to also tell it to ignore TAB characters.&amp;nbsp; I looks like&amp;nbsp;your original program file had tab characters in it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should probably change your editor settings so that the tabs are replaces by spaces.&amp;nbsp; The tabs will not only cause trouble for people editing the program files they will cause you trouble when trying to analyze the dataset you created by reading in the LOG file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It also had another non-ASCII character being used in this statement.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile SASlist dlm="�";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You should probably replace that with a hex literal to avoid having issues when switching between character encodings.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile SASlist dlm="AC"x;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also I would not use PROC IMPORT to read in a CSV file, especially one where you expect it to have a specific format.&amp;nbsp; Just write the data step to read it yourself.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jan 2026 00:19:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Special-Character-in-Log-File-Hindering-Full-Import/m-p/981667#M379173</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2026-01-08T00:19:19Z</dc:date>
    </item>
  </channel>
</rss>

