Date: Wed, 11 Jun 2003 00:30:54 -0700
Reply-To: Stig Eide <stigeide@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Stig Eide <stigeide@YAHOO.COM>
Organization: http://groups.google.com/
Subject: Re: multiple email by SAS
Content-Type: text/plain; charset=ISO-8859-1
Hi Richard.
I have done this by writing a SAS program on the fly and then %included it.
Example Code:
* making a test dataset;
data mail;
attrib email length=$30
utdanning length=$4
;
infile cards dlm=' ';
input email utdanning;
cards;
test@gjensidigenor.com K123
test@gjensidigenor.com K124
test@gjensidigenor.com K125
test@gjensidigenor.com K126
anders@gjensidigenor.com K120
arne@gjensidigenor.com K133
arne@gjensidigenor.com K163
;
proc sort;
by email utdanning;
run;
*Writing the SAS program;
data _null_;
set mail;
by email;
file 'c:\temp\email.sas';
if first.email then do;
put 'data _null_;';
put 'file outbox';
put 'to=("' email '")';
put 'subject="Courses";';
put 'put "Here is a list of your courses:";';
end;
put 'put "' utdanning '";';
if last.email then do;
put 'put "Regards";';
put 'run;';
end;
run;
*Initierer mail;
filename outbox email "Ron B" emailsys=VIM
emailpw="mypassword" emailid="myuserid";
*Sending the mails;
* Commenting out this for testing...
%include "c:\temp\email.sas";
"Richard Liu" <kataliu@earthlink.net> wrote in message news:<wtwFa.44501$Io.3910443@newsread2.prod.itd.earthlink.net>...
> Hi,
>
> I know how to send email via SAS by filename method with data _null_ step.
>
> However, can someone tell me how to do it with multiple email addresses at
> once?
>
> Thank you.
>
> R.