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

 

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;

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

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.

View solution in original post

11 REPLIES 11
Reeza
Super User
Not that I'm aware of, why do you need them removed?

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.
magicdj
Fluorite | Level 6

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

SASKiwi
PROC Star

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.

Reeza
Super User
RESETLINE as indicated in your previous question is the next best option, which resets your line numbering.

Is there a specific reason for why that won't work?
SASKiwi
PROC Star

The NONUMBER SAS option removes page numbers from SAS printed output. It has nothing to do with removing numbers SAS log numbers:

https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.4&docsetId=lesysoptsref&docsetTarget...

 

There isn't any option I'm aware of to remove SAS log line numbers. Why do you want to remove them?

VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

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.

Kurt_Bremser
Super User

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.

magicdj
Fluorite | Level 6

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.

Tom
Super User Tom
Super User

@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.

magicdj
Fluorite | Level 6

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

SASKiwi
PROC Star

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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 11 replies
  • 3151 views
  • 2 likes
  • 6 in conversation