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;
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.
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
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.
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?
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.
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.
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.
@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.
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
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
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.