BookmarkSubscribeRSS Feed
mjaitly
Fluorite | Level 6

Hi

Need some urgent help in EG.

I wish to send automated email reports (with excel attachment) to our top 200 customers - report will have data such as their last purchase date, amount, etc. I have a dataset that consists of data related to these top 200 customers. I want to make a program that loops through every record (one record for every customer) in the dataset, creates a list report in EG, and then pastes that list report in Excel and send it through email (outlook) to the customer. This entire process should be automated in EG. I know Base SAS language but do not know Macro programming. Can anyone please help me?

It will be great if someone can help me with the code.

Thanks

Manish

4 REPLIES 4
Quentin
Super User

Hi,

Suggest you search for SAS papers about emailing results. Easiest probably to search lexjansen.com for mail merge, email, etc.

Could be tough to set it up without macro prorgamming (at least for me).

With the macro language, you could write a macro which produces the report for one customer (probably with ods tagsets.excelxp  if you want an excel-like attachment, or ods html if you want to the table in the body of the email) and then emails it.  Then you could loop through your list of 200 customers calling the macro for each.

--Q.

BASUG is hosting free webinars Next up: Jane Eslinger presenting PROC REPORT and the ODS EXCEL destination on Mar 27 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
SASKiwi
PROC Star

Also please note that any SAS programs involving email communication run from EG will run on your SAS server.

If your SAS server is "local" then SAS on your EG PC will send the email through your local email client. If you have a remote SAS server then email will be sent via the email software on that server.

Cynthia_sas
SAS Super FREQ

Hi, just my .02 on the subject. You also have to remember that email options fall into 2 categories - -the options like TO and FROM and SUBJECT and possibly the attachment that will change with the mail for every customer. But then there are also system level options related to emailing from SAS that have to be established at start-up time. You would need to work with your SAS administrator and/or your e-mail administrator to be sure that 1) you can send automated emails and 2) you know the right type of email to use and 3) to make sure that the proper system options are set for your SAS session (whether local or server based).

cynthia

jakarman
Barite | Level 11

The best entries with you will find using "tilanus" eg: http://support.sas.com/resources/papers/proceedings13/023-2013.pdf


Mailing using Outlook with Eguide is a nogo. SAS and Outlook are not connected that way.  Microsoft did a lot of work to stop Spammers.
You can use mail with SAS but you are needing to bypass the spammer protection. What you are needing is a mail configuration within SAS that is open enough.
As a pitty SAS is far behind market evolvments. You are needing possibly to run the latest SAS-version (ssl password).


SAS(R) 9.4 System Options: Reference, Second Edition ( EMAILHOST= System Option).

The server / mail traffic must not be blocked to reach those mailservers by a firewall.

The older mail configurations are relying on "bulk-mail" that is an open relay defined to a mail-server. You have to negotiate for that to get those kind of things open.
Within bigger organizations sometimes this is done as part of a service.  


---->-- ja karman --<-----

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 908 views
  • 0 likes
  • 5 in conversation