- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Is there a quick way to remove the log line numbers? In the example below, I'm hoping to remove the '483' ...without having to manually do it. Once a while I didn't save the codes but found them in the log files, then have to remove the numbers before I could submit the code again.
Thank you!
the lazy beginner
483 proc print data=work.Ptest;
484 format hired birth date7.;
485 run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You may find that running SAS code from within a SAS macro may provide some limited relief, or at least different behavior, however don't expect the code to have line-breaks where you might normally expect.
Scott Barry
SBBWorks, Inc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Run> Recall Last Submit.
HTH,
Reeza
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Scott Barry
SBBWorks, Inc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Get your log into the SAS editor using FILE/OPEN.
Press the ALT key and at the same time select the top left-hand corner of your log in the column just to the right of your line numbers by clicking with your mouse button. Now drag the mouse down to the bottom right-hand corner of your log. You should now have highlighted your SAS program without the line numbers.
You still have to do some tidying up to get rid of SAS messages but its a whole lot quicker than editing each line. This trick also works in the LOG window.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
let SAS do the work
have a SAS program
1 open/read that log,
2 recognise relevant lines start with a number
3 open an output.sas.txt file
4 strip the log line number out of the log line
5 write what is left of the log line
data _null_ ;
infile 'C:\Applications\UK.Liquidity2\altlogs\461.log' ;
input @ ;
if _infile_ ne ' ' ; * not blank ;
if '0' < substr( _infile_,1,1) <= '9' ; * begins with number ;
num_end = index( _infile_, ' ' ) ; * find blank ;
_infile_ = substr( _infile_, num_end ) ; * take rest of line ;
file 'output.sas.txt' ;
put _infile_ ;
run ;
rough but ready
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I stumbled upon this code, but was unable to get it to work. I am guessing since 2010 the syntax has changed a bit. In any case here is an update in case anyone needs to do this:
data _null_;
infile 'C:\FillMeIn\test.log';
input @;;
if _infile_ ne ' '; * not blank ;
if '0' < substr(_infile_,1,1) <= '9'; * begins with number ;
num_end = index(_infile_, ' '); * find blank ;
_infile_ = substr(_infile_, num_end); * take rest of line ;
file 'C:\FillMeIn\test_no_line_numerbers.log';
put _infile_;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You may also open your log file with a good programing editor like Notepad++, select the section that you want and use the command Delete line numbers or first word.
PG
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I pasted into Excel, using the text import wizard I set the fixed width so it made a column break after the line number, then I simply copied the second column.