BookmarkSubscribeRSS Feed
Sharath_naik
Obsidian | Level 7

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 "&emsp; 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

2 REPLIES 2
RichardDeVen
Barite | Level 11

Show the data you have for tables NEW_FILE, ACK, and WANT

Kurt_Bremser
Super User

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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 649 views
  • 0 likes
  • 3 in conversation