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= '[email protected]' ;
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;