BookmarkSubscribeRSS Feed
Rajeshganta
Calcite | Level 5
I have a data with their performances with different students i want to send mail to each one individually to thier email ids and to their parents
10 REPLIES 10
Quentin
Super User
This is definitely possible with SAS. Please post the code you have tried (along with sample data) and describe what is going wrong. If you're not sure where to start, I would try searching user group papers over at lexjansen.com; there will be plenty of papers that present ways to send email from SAS.
The Boston Area SAS Users Group is hosting free webinars!
Next up: SAS Trivia Quiz hosted by SAS on Wednesday May 21.
Register now at https://www.basug.org/events.
Rajeshganta
Calcite | Level 5
Data is as posted above i want to semd the data individually to student 1 and 2
Quentin
Super User

Sorry, I don't see data or code in your message.  I only see one sentence.

The Boston Area SAS Users Group is hosting free webinars!
Next up: SAS Trivia Quiz hosted by SAS on Wednesday May 21.
Register now at https://www.basug.org/events.
Rajeshganta
Calcite | Level 5
Data is like
Stntid name marks email fatheremail
123 abc 78 123.gmail fath1.gmail
234 bcd 98 234.yahoo fath2.yahoo
Rajeshganta
Calcite | Level 5

Please find the attachment of the requirement to give a better solution

Quentin
Super User

Please post the code you have tried and describe what is going wrong.   FYI, many people won't read attachments, due to their ability to spread malware. 

The Boston Area SAS Users Group is hosting free webinars!
Next up: SAS Trivia Quiz hosted by SAS on Wednesday May 21.
Register now at https://www.basug.org/events.
Rajeshganta
Calcite | Level 5
I have assigned a sno and linked a do loop with number, email script is next to that, snapshot format but it is not working
Quentin
Super User

Sorry, if you're unable to share your code, it's too hard to help figure out what is going wrong.  

 

For tips on how to write a clear question that makes it easier for others to help you, please see these  articles:

https://communities.sas.com/t5/SAS-Support-Communities/How-to-ask-a-good-question-and-receive-a-fast...

https://communities.sas.com/t5/Getting-Started/How-to-get-fast-helpful-answers/ta-p/226133

 

 

The Boston Area SAS Users Group is hosting free webinars!
Next up: SAS Trivia Quiz hosted by SAS on Wednesday May 21.
Register now at https://www.basug.org/events.
Rajeshganta
Calcite | Level 5

Firstly i have data as 

sno name marks email fatheremail

1 abc 95 xxx.gmail fxxx.gmail

2 bcd 65 yyy.gmail fyyy.gmail

3 cda 57 zzz.gmail fzzz.gmail

1st step:

data snap;

set Work.data;

do i=1 to 3 by 1

/*mailer code starts*/

file name message email to =('email')

cc=(fatheremail)

subject= marks

CT="Text/HTML";

ods listing close;

ods html body = message rs= none style=normal;

/*body of email*/

proc sql;

title j=left height 11pt clolour black font=""

Quit;

Proc Tabulate

Data=work.snap;

var

class

marks* sum*F = BESTX12.

run;

footnote;

end;

run;

 

 

This is the program i am using but getting an error as do loop is not completed

Quentin
Super User

Hi,

 

There are several problems with your code.  Instead of writing the whole thing at once, I would develop it in steps, e.g.:

  1. Code to send one email with "hello".
  2. Code to generate the HTML report you want (PROC TABULATE, or whatever).
  3. Code to send one email with a custom HTML report in the body.
  4. Code to read a dataset and send multiple emails

I would suggest looking at user group papers for examples, this one looked handy:

https://support.sas.com/resources/papers/proceedings/pdfs/sgf2008/038-2008.pdf

 

 

The Boston Area SAS Users Group is hosting free webinars!
Next up: SAS Trivia Quiz hosted by SAS on Wednesday May 21.
Register now at https://www.basug.org/events.

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

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
  • 10 replies
  • 2071 views
  • 0 likes
  • 2 in conversation