Hello Haris, Thank you for your reply! The interactive user input you mentioned is not an option as the program is running as a batch in the Windows scheduler, so I cannot perform any user interaction. The program just queries a database and sends an e-mail with the query results as an Ecxel attachment (see the code fragment below): proc sql exec;
connect to odbc(datasrc="<datasource>" USER="<user>" PASSWORD="<password>");
create table work.<dataset> as
select *
from connection to odbc(
select
...
from
...
where
...
;
)
;
disconnect from odbc;
quit;
run;
proc export
data=work.<dataset>
outfile="<file path>"
dbms=xlsx replace;
run;
options emailsys = SMTP;
options emailhost = "<e-mail host>";
options emailauthprotocol = NONE;
filename anyname email
to="<e-mail address>"
from="<e-mail address>"
sender="<e-mail address>"
subject="<subject>"
attach=("<file path>" content_type="application/xlsx");
data _null_;
file anyname;
put '<mail body>';
run; In attached zip file you will find a screenshot showing the way that the condition was added to the process flow. However, when exporting the program, this condition seems to be ignored. Would you know another way to implement the condition in such a way that it gets included in the exported code? Thanks, Barry
... View more