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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 915 views
  • 0 likes
  • 3 in conversation