Zhiyong Zhang's Psychometric Website
 
Home Control Panel Login Register Search Submit Logout About me Contact me
My Research
Google
Web
This Site
Home > Send results inside SAS to your email
Send results inside SAS to your email
2006-07-02    Zhiyong Zhang       Read: 8852 times
Cite this page: Zhiyong Zhang (2006). Send results inside SAS to your email. Retrieved April 25, 2024, from https://www.psychstat.org/us/article.php/57.htm.
http://www.psychstat.org/us/article.php?articleid=57

The idea here is to first save your output into a file and then send the file as an attachment into your email. We illustrate this process using an example.

1. This example first creates a data set called sendmail and then prints the content of the data set into the output.

/*Create an example*/
data sendmail;
input test;
cards;
1
2
3
5
;
run;

proc print data=sendmail;
run;

2. The output is then saved into a file called test.out using the codes like

/*Save the output and the log into files*/
DM OUTPUT 'FILE "c:\send\test.OUT"';
DM LOG    'FILE "c:\send\test.LOG"';

3. Finally, we send this output file as attachment to your email using the codes like

/*Send the output to your email*/
data _null_;
call system('c:\send\mailcmd "mail.xxxx.xxxx"
"xxxx@gmail.com" "xxxx@gmail.com" "Subject: SAS results" "Contents: SAS results" "" "c:\send\test.OUT"');
run;

In this step, we used a dos program called mailcmd which can be downloaded by clicking this link http://www.sms4mail.com/download/mailcmd.zip. In my example, I put this dos file in the folder "c:\send".

Run step 1 to 3, you will receive an email with the file test.out as an attachment.

Submitted by: johnny
Add a comment View comment Add to my favorite Email to a friend Print
If you want to rate, please login first, or click here to register. Or you can use USERNAME: guest and PASSWORD: guest to log in.
Average score 0, based on 0 comments
1 2 3 4 5 6 7 8 9 10
Latest comment (Total: 1 ) Time Author Reply
mailcmd can not be download 2007-03-14 08:41 am kuhasu 1
More comments...

Copyright © 2003-13 Zhiyong Zhang \'s Psychometric Website
Maintained by Zhiyong Zhang