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

Hello I am trying to create a log file by using proc print but when I run my program it creates an rtf

 %let analydir=\\Biostatistics\Analysis\ ;

ods tagsets.rtf(ID=l_chemo) file="&analydir.\Output\l_10_chemotherapy.rtf" style=myrtfn; *styles.rtfn;

proc report nowd /*headline*/ headskip split='*' data=blank spacing=1 missing ;
  cols  a;
  define a / display '';
run;
         		   	        		 
  
ods tagsets.rtf(ID=l_chemo) close
ODS RTF close;

proc printto log="&analydir.\Log\l_10_chemo.rtf" NEW;
run;

RTF output:

HitmonTran_0-1680810993879.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
 %let analydir=\\Biostatistics\Analysis\ ;

proc printto log="&analydir.\Log\l_10_chemo.txt" NEW;
run;

ods tagsets.rtf(ID=l_chemo) file="&analydir.\Output\l_10_chemotherapy.rtf" style=myrtfn; *styles.rtfn;

proc report nowd /*headline*/ headskip split='*' data=blank spacing=1 missing ;
  cols  a;
  define a / display '';
run;
         		   	        		 
  
ods tagsets.rtf(ID=l_chemo) close;
ODS RTF close;

PROC PRINTTO goes before your proc and you're missing a semicolon on one of your ODS statements.

 

View solution in original post

3 REPLIES 3
Tom
Super User Tom
Super User

LOG files have the text with the code you ran and the notes SAS generated.

What would that have to do with PROC PRINT?

 

And your posted code is not using PROC PRINT anyway.  It is using PROC REPORT.

 

You can redirect the LOG messages using PROC PRINTTO, but you have to do it BEFORE the messages are generated, not after.

 

Just because you named the file you redirected the LOG to with a .rtf extension it will not make the content of the file be RTF code.

Reeza
Super User
 %let analydir=\\Biostatistics\Analysis\ ;

proc printto log="&analydir.\Log\l_10_chemo.txt" NEW;
run;

ods tagsets.rtf(ID=l_chemo) file="&analydir.\Output\l_10_chemotherapy.rtf" style=myrtfn; *styles.rtfn;

proc report nowd /*headline*/ headskip split='*' data=blank spacing=1 missing ;
  cols  a;
  define a / display '';
run;
         		   	        		 
  
ods tagsets.rtf(ID=l_chemo) close;
ODS RTF close;

PROC PRINTTO goes before your proc and you're missing a semicolon on one of your ODS statements.

 

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
  • 3 replies
  • 600 views
  • 0 likes
  • 4 in conversation