Email from dataset is not switchable like that, you would need to wrap it in macro, something like:
%macro SendMail (bha=); data _null_; %if &bha.=0 %then %do; file outbox from=mymail to=xxx subject='reports'; put 'Good Day'; %end; %else %do; file outbox from=mymail to=xxx subject='reports' attach=(&all_files.); put 'attach are reports'; %end; run; %mend SendMail; %SendMail (bha=1); /* For no reports, just change 1 to 0 */
Email from dataset is not switchable like that, you would need to wrap it in macro, something like:
%macro SendMail (bha=); data _null_; %if &bha.=0 %then %do; file outbox from=mymail to=xxx subject='reports'; put 'Good Day'; %end; %else %do; file outbox from=mymail to=xxx subject='reports' attach=(&all_files.); put 'attach are reports'; %end; run; %mend SendMail; %SendMail (bha=1); /* For no reports, just change 1 to 0 */
There are various substitutions that cannot be used as a parameter expansion. You have to map the root directory as well as you have to make sure that name will not be used in the directory name.
For more access plugins uae
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.