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
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.