Help using Base SAS procedures

log Error

Reply
N/A
Posts: 0

log Error

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;
Regular Contributor
Posts: 165

Re: log Error

Posted in reply to deleted_user
Looks like you have the file already open. It is a good idea to include a path name when you open an ods destination.
SAS Super FREQ
Posts: 8,864

Re: log Error

Posted in reply to deleted_user
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.)
Ask a Question
Discussion stats
  • 2 replies
  • 554 views
  • 0 likes
  • 3 in conversation