ERROR: File is in use, . for SAS Emails

Reply
New Contributor
Posts: 2

ERROR: File is in use, . for SAS Emails

I have a simple program that checks a log and sends the results to the team once a program is complete. The file 'update_log' is the log of the program that has been uploaded into a SAS data set. The below code used to work with no issues, but now I am seeing ERROR: File is in use, .. I've read that this happens with the ODS statement sometimes, but I need it to be able to work with the filename statement. 

 

%let EMAIL= 'fake@email.com' ;

filename outfile clear;
filename outfile email
subject=  Data Update Summary Report &SYSDATE9."
to = (&EMAIL.)
REPLYTO = (&EMAIL.)
type = "text/html";


data _null_;
file outfile;

ODS LISTING CLOSE;
ods html body=outfile ;

ods html text='<div align="center">
<h3>System Message </h3>
<p>SEE WARNING/ERRORS BELOW</p>
</div>';
run;
run;

ods html text='<div align="center">
<body> UPDATE LOG </body>
</div>';
proc print data=UPDATE_LOG noobs label;
run;
ods html close;
ods listing;
RUN;

Regular Contributor
Posts: 185

Re: ERROR: File is in use, . for SAS Emails

Posted in reply to DFHGSGSER

Using "Insert Code" or "Insert SAS Code" to post code will increase readability. 

 

The ODS-statement is a global statment, so placing in within a data step is neither necessary nor has an useful effect. You don't need ODS-statements at all, just use put-statement in the data step to write the html-tags (not sure if this solves the problem).

 

 

 

 

Ask a Question
Discussion stats
  • 1 reply
  • 111 views
  • 0 likes
  • 2 in conversation