BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Srigyan
Quartz | Level 8

I am trying to paste a table in my mail body. However I can't create an ods output first. my code is

 

 

%let mail=deepankar.srigyan@shopdirect.com;
ods select none;
/*ods select all;-can't use this */

data table2;
input conversion_date :date7. rate;
format conversion_date date9.;
datalines;
01Jan17 110
15Jul17 96
06Mar18 104
;



   filename temp email to=(&mail.) 
            subject="sas forecasting | data prep | report| Daily file transfer summary"
            type="text/html";

   ods html body=temp
style = Listing;

/*   proc print data=table2;*/
/*   run;*/

     proc report data=table2;
   run;

   ods html close;

just to note I can't do "ods select all" as this is not supported in my production environement. So is there any way I can paste the table  in my mail body without changing the ods option here.

 

1 ACCEPTED SOLUTION

Accepted Solutions
DaveHorne
SAS Employee

Here's a basic example that I use for various emails:

 

 

filename mailbox email                                                                                                                  
    subject="Test sashelp.class"                                                                                                        
         to=("deepankar.srigyan@shopdirect.com")                                                                                        
       type="text/html";                                                                                                                
                                                                                                                                        
ods listing close;                                                                                                                      
ods MSOffice2K body=mailbox style=Listing;                                                                                              
                                                                                                                                        
proc print data=sashelp.class;                                                                                                          
run;                                                                                                                                    
                                                                                                                                        
ods _all_ close;                                                                                                                        
ods listing;

 

 

View solution in original post

1 REPLY 1
DaveHorne
SAS Employee

Here's a basic example that I use for various emails:

 

 

filename mailbox email                                                                                                                  
    subject="Test sashelp.class"                                                                                                        
         to=("deepankar.srigyan@shopdirect.com")                                                                                        
       type="text/html";                                                                                                                
                                                                                                                                        
ods listing close;                                                                                                                      
ods MSOffice2K body=mailbox style=Listing;                                                                                              
                                                                                                                                        
proc print data=sashelp.class;                                                                                                          
run;                                                                                                                                    
                                                                                                                                        
ods _all_ close;                                                                                                                        
ods listing;

 

 

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
  • 1 reply
  • 1390 views
  • 0 likes
  • 2 in conversation