BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

Kindly have a look at the code and problem that i'm stucked in below :

Code -

ods rtf file='est4.rtf'/*initialise the RTF file est4 and send the results to the file est4.rtf until the file is closed*/;
title 'Regression model';
proc reg data = review1 outest = est4;
model Z = X Y U V / SELECTION = rsquare cp aic sbc b best=3;
RUN;
quit;
ods rtf close /* close the RTF file est4*/;

Querry-
What code should i use so that the output is printed exactly what is in the output file 'est4' as i do not get the Root Mean Squared Error column that is in the file 'est4' in the word file that gets opened when i use ODS command in the above code

kindest regards,
Mark
2 REPLIES 2
Cynthia_sas
Diamond | Level 26
Hi:
The tabular output from PROC REG is being routed to the ODS RTF file. The output dataset, WORK.EST4 (from your OUTEST= option) is NOT being routed to the RTF file. It is sitting in the WORK library.

If you want to see what's inside the WORK.EST4 file, as you would see, if you did a PROC PRINT, then I suggest that you put a PROC PRINT step for WORK.EST4 before your ODS RTF CLOSE; statement. Just because you name the RTF file EST4.RTF does not mean that the dataset WORK.EST4 will automatically be routed to the RTF file.

cynthia
Sandhya
Fluorite | Level 6
Hi,

As Cynthia@sas said add a proc print statement.


title 'Regression model';
proc reg data = review1 outest = est4;
model Z = X Y U V / SELECTION = rsquare cp aic sbc b best=3;
RUN;
quit;

ods rtf file='est4.rtf'/*initialise the RTF file est4 and send the results to the file est4.rtf until the file is closed*/;
proc print data=est4;
title' ';
run;
ods rtf close /* close the RTF file est4*/;

Sandhya.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1040 views
  • 0 likes
  • 3 in conversation