BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello,

I use the code :

ODS RTF;
proc boxplot;
plot (A B C D)*Z;
run;
ODS RTF CLOSE;

and get
LOG Error -

86 ODS RTF;
ERROR: File is in use, C:\Users\Minka\sasrtf.rtf.
ERROR: Fatal ODS error has occurred. Unable to continue processing this output destination.
WARNING: No body file. RTF output will not be created.
87 proc boxplot;
88 plot (A B C D)*Z;
89 run;

NOTE: Since an input data set was not specified, data set REVIEW1 is assumed as a DATA= data set.

NOTE: Processing beginning for PLOT statement number 1.
NOTE: PROCEDURE BOXPLOT used (Total process time):
real time 0.55 seconds
cpu time 0.53 seconds

NOTE: There were 50 observations read from the data set WORK.REVIEW1.

90 ODS RTF CLOSE;
3 REPLIES 3
RickM
Fluorite | Level 6
Looks like you have the file already open. It is a good idea to include a path name when you open an ods destination.
Cynthia_sas
SAS Super FREQ
Hi:
ODS is telling you what the problem is (as Rick pointed out):
[pre]
ERROR: File is in use, C:\Users\Minka\sasrtf.rtf.
ERROR: Fatal ODS error has occurred. Unable to continue processing this output destination.
[/pre]


Because you used the "simple" ODS RTF invocation method, ODS used the default name of: C:\Users\Minka\sasrtf.rtf -- the most common reason that generates this error message is that you look at your output in Word, decide to change something, switch from Word back to SAS, change and resubmit your program -- BUT, you forgot to close Word. When Microsoft Word holds a file open, it holds it open in WRITE mode -- for editing. So, when SAS goes back a second time to re-create the file, it cannot write over that file because Word has exclusive access rights to the file.

To avoid this issue, either
1) Close Word, and/or close the SAS results viewer instance of Word to free up the file name for re-creation
or
2) explicitly change the FILENAME -every time- you do a resubmit (which is hard to do if you do not use a FILE= option) so it doesn't matter to SAS whether Word has the -previous- file still open for write access.

As Rick suggested, using a FILE= option might help you find your file again. Sample code to specify a FILE name is:
[pre]
ods listing close;
ods rtf file='c:\temp\markc_univ.rtf';
** your code;
ods rtf close;
[/pre]

cynthia

PS -- you will encounter this same behavior with ODS PDF (file must not be in use in order for ODS to overwrite the file.)
Cruise
Ammonite | Level 13
Thanks. It helped!!

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

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
  • 3751 views
  • 1 like
  • 4 in conversation