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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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