- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
well, I try to use proc printto save log, the log shows numbering on left. is there any way to remove it?
OPTIONS NONUMBER not working? thanks
NOTE: PROCEDURE PRINTTO used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds
3 ods escapechar='^';
4
5 proc sort data=sashelp.class out=class;
6 by sex;
7 run;
proc printto log='C:\Desktop\backup\CA402.log' new;
run;
ods escapechar='^';
proc sort data=sashelp.class out=class;
by sex;
run;
data c11;
set class;
length sexf $50.;
dup=1 ;output;
dup=2; output;
dup=3 ;output;
dup=4; output;
run;
data c1;
length sexf2 $50.;
set c11;
if dup=1 then sexf=sex;
if dup=2 and sex='F' then sexf='g';
if dup=2 and sex='M' then sexf='h';
if dup=3 and sex='F' then sexf='i';
if dup=3 and sex='M' then sexf='j';
if dup=4 and sex='F' then sexf='k';
if dup=4 and sex='M' then sexf='l';
dupc=STRIP(PUT(dup, 8.));
if age in (11 12 13 ) then sexf2=strip(sexf)||strip(dupc)||' multi tests3 multi tests3';
else sexf2=strip(sexf)||strip(dupc)||' multi tests3 multi';
sexf3=strip(sex);
sexf4=' multi tests3';
group=1;
run;
proc sort data=c1;by sexf4 sexf3 sexf2 age group;run;
PROC MEANS DATA=c1 NOPRINT;
BY sexf4 sexf3 sexf2 age group;
VAR Weight;
OUTPUT OUT=AB
N=N0
MEAN=Mean0
CV=CV0
STD=SD0
STDERR=SE0
LCLM=LCLM
UCLM=UCLM
MIN=MIN0
Q1=Q10
MEDIAN=Median0
Q3=Q30
MAX=MAX0;
RUN;
PROC tabulate data=ab ORDER=data;
by sexf4 sexf3 sexf2;
CLASS sexf4 sexf3 sexf2 age group;
VAR n0 median0 q30 MIN0 MAX0 ;
keyword mean / style=[just=R];
keyword StD / style=[just=L];
TABLE
sexf4=" "*sexf3=" "*sexf2=" "*age=" "*(
n0='n'*max=''*f=4.
median0='Median'*max=''*f=8.2
Q30='Q3'*max=''*f=8.2
min0='Tmin'*max=''*f=8.2
max0='Max'*max=''*f=8.2
), age=" "
/ misstext='---' box=" sex" RTS=30 ;
RUN;
OPTIONS CENTER NODATE NONUMBER ORIENTATION=landscape CENTER LEFTMARGIN="1 IN" RIGHTMARGIN="1 IN" TOPMARGIN="1 IN" BOTTOMMARGIN="1 IN" ;
proc printto;
run;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If you run your program in batch mode then a SAS log file is created automatically with the correct line numbering starting at 1 and you don't need to use PROC PRINTO at all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Several text editors have that function and you can hold down ALT+mouse the selection and it will select in blocks so you can avoid the line numbers, at least this works in Base SAS, not sure about Studio or Viya.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I use sas 9.4,
since I used proc printo, the log show start line 3. if I can remove numbers. it won't looks like it start from line 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If you run your program in batch mode then a SAS log file is created automatically with the correct line numbering starting at 1 and you don't need to use PROC PRINTO at all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Is there a specific reason for why that won't work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The NONUMBER SAS option removes page numbers from SAS printed output. It has nothing to do with removing numbers SAS log numbers:
There isn't any option I'm aware of to remove SAS log line numbers. Why do you want to remove them?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
the log line numbers are used when there is an issue. that is how the log references you line of code. removing them does nothing more that echo's your program and the final results unless there is an error and how many select * options will you have to go through to find the correct one if there is an issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
As others have stated, the line numbers are essential for navigating the log, and removing them would only make debugging harder (and that's the logs foremost usage).
If you need to copy code out of the log (eg code generated by proc import/export), follow @Reeza 's advice and hold down the Alt key while marking the text so you get a nice block that excludes the leading columns with the line numbers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
In my program, it has:
%let path=%sysget(SAS_EXECFILEPATH);
that’s where the problem from. I use sysget to get folder path.
Just need to go around of it. then batch run will work and save log the way I want. it will solve the problem in this post and previous post
Thanks a lot for your help.
WARNING: The argument to macro function %SYSGET is not defined as a system variable.
NOTE: No units specified for the GUNIT option. CELLS will be used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@magicdj wrote:
In my program, it has:
%let path=%sysget(SAS_EXECFILEPATH);
that’s where the problem from. I use sysget to get folder path.
Just need to go around of it. then batch run will work and save log the way I want. it will solve the problem in this post and previous post
Thanks a lot for your help.
WARNING: The argument to macro function %SYSGET is not defined as a system variable.
NOTE: No units specified for the GUNIT option. CELLS will be used.
I am not really seeing how this has anything to do with the original post. That environment variable is something that the "enhanced" editor available in the Windows (only) version of SAS when running interactively using Display Manager interface.
If you want clean SAS logs then save the code as a stand alone program and submit it in batch (background) in its own SAS session. Then your log will have everything that has happened and can be used as your audit trail. Don't try to use interactive sessions to do production work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
got it, thanks for the advise.
yes, I want clean logs. at the beginning, I don't know how to make batch run works, so I'm thinking about remove log numbers...haha
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Have you figured out how to do a batch run now? It is simply a matter of running from an OS command line: sas MySASProgram.sas