BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
d6k5d3
Pyrite | Level 9

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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?


 

View solution in original post

5 REPLIES 5
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

Kurt_Bremser
Super User

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.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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;
Reeza
Super User

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?


 

d6k5d3
Pyrite | Level 9
Brilliant! Even though it does not clear log, and start a fresh counting, it definitely helps me get rid of deleting those line counts. Thank you!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 5 replies
  • 1083 views
  • 4 likes
  • 4 in conversation