proc sql noprint;
select count(file)into :cnt from new_file;
select email_id into :email_id from ack;
select cat into :cat from want;
quit;
%put &cat.;
%macro Mail_S;
%if &cnt %gt 0 %then %do;
OPTIONS EMAILSYS=SMTP EMAILHOST=intramail.cis.cat.com EMAILID="abc@com";
FILENAME BLAT EMAIL
FROM = ( "Abc@com" )
TO = ( "Abc@com" )
cc = ("Abc@com")
SUBJECT = ( "New Order Acknowledgement -(&sysdate9.)")
ATTACH = ( &cat. ct='application/octet-stream' )
TYPE = "TEXT/HTML"
;
DATA _NULL_;
FILE BLAT;
PUT '<HTML><BODY>';
put "Hi Team,<BR>";
put "  recieved on &sysdate9..<BR><BR>";
put 'If you have any questions,<BR><BR>';
put "Thank You, <BR><BR>";
put "Team<BR><BR>";
put '</BODY></HTML>';
run;
%end;
%mend Mail_s;
%mail_s;
When ever i send using above code, only one pdf file is able to open , remaining file will not be opened , please help me to figure out thisissue
Show the data you have for tables NEW_FILE, ACK, and WANT
Create a correct list of files to be attached:
select quote(strip(cat)) into :cat separated by " " from want;
and you'll get a list of quoted filenames as described in the documentation of FILENAME EMAIL.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.