SAS has so far logged 14678 lines of code, note, warnings etc. I have to copy some code snippets from log. But the problem is when I copy, the line counts also get copied, and I have to manually delete all of those. It's very tedious and boring when the code is really long.
That's why I was thinking if there's a way to clear log and start fresh counting.
Any suggestion?
That's why you hold down alt while selecting and that allows you to not select the line numbers and not have this problem in the first place. You can also use PROC PRINTTO to direct the log to a file and several text editors (NotePad++, textWrangler) will remove line numbers.
@d6k5d3 wrote:
SAS has so far logged 14678 lines of code, note, warnings etc. I have to copy some code snippets from log. But the problem is when I copy, the line counts also get copied, and I have to manually delete all of those. It's very tedious and boring when the code is really long.
That's why I was thinking if there's a way to clear log and start fresh counting.
Any suggestion?
Log where? Using what software? If its desktop SAS, then you can use the shortcut keys and set one to be cle log, thats what I used to do, then press the shortcut key, then f8 to run code.
If its other software not entirely sure.
If its from code, then you can run (in some systems) run:
dm 'cle log';
You could also shrink your log by using:
options nomlogic nomprint nosymbolgen nosource nosource2;
Plus various other options,
You can also condense the log by various means such as noprint options.
Without some information though its hard to say.
But the dm "clear log" does not reset the line counter; my search in the documentation has not revealed a statement or command to reset the log line counter.
Ah, I should have read the post more thoroughly. In which case, I would suggest having a printto directing the log output to a file. Then have a snippet of code which can read that log file and just strip out line numbers, a simple:
data _null_; file ".../want.txt"; infile "...have.log"; input; put(scan(_infile_,2," ")); run;
That's why you hold down alt while selecting and that allows you to not select the line numbers and not have this problem in the first place. You can also use PROC PRINTTO to direct the log to a file and several text editors (NotePad++, textWrangler) will remove line numbers.
@d6k5d3 wrote:
SAS has so far logged 14678 lines of code, note, warnings etc. I have to copy some code snippets from log. But the problem is when I copy, the line counts also get copied, and I have to manually delete all of those. It's very tedious and boring when the code is really long.
That's why I was thinking if there's a way to clear log and start fresh counting.
Any suggestion?
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.