BookmarkSubscribeRSS Feed
Sharath_naik
Obsidian | Level 7

Hi Team , 

 

Please help to send bulk PDF file . below code I'm using 


%macro Mail_S;
%if &cnt %gt 0 %then %do;
OPTIONS EMAILSYS=SMTP EMAILHOST=XXXXXXXXXXX EMAILID="Analytics@cat.com";
FILENAME BLAT EMAIL
FROM = ( "Analytics@cat.com" )
TO = ( "Analytics@cat.com" )

SUBJECT = ( "New Order (&sysdate9.)")
ATTACH = ( &cat. ct='application/octet-stream' )
TYPE = "TEXT/HTML"

;
DATA _NULL_;
FILE BLAT;
PUT '<HTML><BODY>';
put "Analytics<BR><BR>";
put '</BODY></HTML>';
run;
%end;
%mend Mail_s;

%mail_s;

 

2 REPLIES 2
ballardw
Super User

@Sharath_naik wrote:

Hi Team , 

 

Please help to send bulk PDF file . below code I'm using 


%macro Mail_S;
%if &cnt %gt 0 %then %do;
OPTIONS EMAILSYS=SMTP EMAILHOST=XXXXXXXXXXX EMAILID="Analytics@cat.com";
FILENAME BLAT EMAIL
FROM = ( "Analytics@cat.com" )
TO = ( "Analytics@cat.com" )

SUBJECT = ( "New Order (&sysdate9.)")
ATTACH = ( &cat. ct='application/octet-stream' )
TYPE = "TEXT/HTML"

;
DATA _NULL_;
FILE BLAT;
PUT '<HTML><BODY>';
put "Analytics<BR><BR>";
put '</BODY></HTML>';
run;
%end;
%mend Mail_s;

%mail_s;

 


Your code does not mention PDF anywhere. So why is the subject about PDF???

 

If you have the macro variable &cat hiding the name of a PDF document then you should show us the values of &cat and where they come from. Not to mention &cnt. When macro variables other than SAS system variables just appear in the middle of code and not passed as parameters you  might be having issues with scope of macro variables, i.e. where they are accessible

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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