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: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 3 replies
  • 3885 views
  • 1 like
  • 4 in conversation