<?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 log line number in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/log-line-number/m-p/786592#M251174</link>
    <description>&lt;P&gt;If anyone knows how to prevent the line numbers from being displayed in the Log Window, please let me know.&lt;BR /&gt;I'm using Windows SAS 9.4 TS1M6 (DMS).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to detect differences in the submit log, but when code is inserted in the middle of the program, all subsequent line numbers are shifted and I can't detect the differences correctly.&lt;/P&gt;</description>
    <pubDate>Sat, 18 Dec 2021 11:06:24 GMT</pubDate>
    <dc:creator>japelin</dc:creator>
    <dc:date>2021-12-18T11:06:24Z</dc:date>
    <item>
      <title>log line number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/log-line-number/m-p/786592#M251174</link>
      <description>&lt;P&gt;If anyone knows how to prevent the line numbers from being displayed in the Log Window, please let me know.&lt;BR /&gt;I'm using Windows SAS 9.4 TS1M6 (DMS).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to detect differences in the submit log, but when code is inserted in the middle of the program, all subsequent line numbers are shifted and I can't detect the differences correctly.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Dec 2021 11:06:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/log-line-number/m-p/786592#M251174</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-12-18T11:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: log line number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/log-line-number/m-p/786594#M251176</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/226565"&gt;@japelin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This topic has been adressed earlier, try a google search on "sas suppress line numbers in log". The conclusions is that it can't be done unless you write a small SAS program to read a log file, remove the line numbers and write the result to another file. Do that on both log files and compare the output files. I use Notepad++ with the compare plugin installed, and it works perfectly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest that you also remove the title lines, because they are a disturbing element in the comparison. A program like this should do the work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename logfile "&amp;amp;logfile";
filename cleaned "&amp;amp;cleaned";
data _null_;
	infile logfile;
	file cleaned;
	input;
	if index(_infile_, '     The SAS System     ') then delete;
	if notdigit(scan(_infile_,1,' ')) = 0 then do;
		firstblank = index(_infile_, ' ');
		substr(_infile_, 1, firstblank-1) = '';
	end;
	put _infile_;
run;
	
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 18 Dec 2021 12:44:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/log-line-number/m-p/786594#M251176</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2021-12-18T12:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: log line number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/log-line-number/m-p/786607#M251184</link>
      <description>&lt;P&gt;What exactly are you trying to determine. "Differences" is a pretty broad topic in general and parsing logs may not be the best way.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Dec 2021 16:58:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/log-line-number/m-p/786607#M251184</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-12-18T16:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: log line number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/log-line-number/m-p/786609#M251185</link>
      <description>&lt;P&gt;Not sure about the line numbers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is an option called GENERIC that will remove a lot of the run specific filenames from the log and so make comparing the logs easier.&lt;/P&gt;
&lt;PRE&gt;693   option generic;
694   filename csv temp;
695
696   data _null_;
697     file csv dsd ;
698     set sashelp.class;
699     put (_all_) (+0);
700   run;

NOTE: The file CSV is:
      (system-specific pathname),
      (system-specific file attributes)

NOTE: 19 records were written to the file (system-specific pathname).
      The minimum record length was 17.
      The maximum record length was 21.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.00 seconds
&lt;/PRE&gt;
&lt;P&gt;I think there is a way to reset the line numbers.&amp;nbsp; So if you insert that option after the place where the code diverges the line numbers should start synch up again.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Dec 2021 17:50:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/log-line-number/m-p/786609#M251185</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-12-18T17:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: log line number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/log-line-number/m-p/786612#M251187</link>
      <description>&lt;P&gt;Thank you.&lt;BR /&gt;I couldn't find it successfully by searching in Community, but I should have googled it first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In addition, when I tried it in my environment, there was a case where it failed.&lt;/P&gt;
&lt;P&gt;When I submitted proc options in a Japanese environment, there was a case where it started with a space followed by a number like this.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-12-19_02h49_13.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66847i114717CB4ACC3E9C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2021-12-19_02h49_13.png" alt="2021-12-19_02h49_13.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think this is a rare case, but assuming the above, I built it as follows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  length f $1 i $10;
  infile logfile;
  file cleaned;
  input;
  f=subpad(_infile_,1,1);
  i=trim(scan(_infile_,1,' '));
  if input(f,??best.) and 
     input(i,??best.) then do;
    firstblank=length(i)+1;
    substr(_infile_,1,firstblank-1)='';
  end;
  put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It took an extra 20% of processing time, but it took just over a second when I tested it on a log of 1.72 million lines, so it was well within the acceptable range.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Dec 2021 17:54:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/log-line-number/m-p/786612#M251187</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-12-18T17:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: log line number</title>
      <link>https://communities.sas.com/t5/SAS-Programming/log-line-number/m-p/786613#M251188</link>
      <description>Putting a RESETLINE in every process just for the log is not very desirable for a program, so I choose to process the log. &lt;BR /&gt;However, the GENERIC option is very useful for what I am trying to do. &lt;BR /&gt;Thank you very much.</description>
      <pubDate>Sat, 18 Dec 2021 18:00:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/log-line-number/m-p/786613#M251188</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-12-18T18:00:47Z</dc:date>
    </item>
  </channel>
</rss>

