DATA Step, Macro, Functions and more

Can SAS Read email inbox ?

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 85
Accepted Solution

Can SAS Read email inbox ?

Hi All,

We get lot of requirements on email to our team email ID asking about certain business logic calculations.

Subject line is always ---- > Enq : Datamart preprocessing

Based on that we search in our logs for that process , I want to automate this process and read subjects of the email box in a SAS Dataset.

I searched on google but could not find much helpful information

Any help in this regard would be really helpful


Accepted Solutions
Solution
‎04-15-2015 04:14 AM
Valued Guide
Posts: 3,208

Re: Can SAS Read email inbox ?

When you are using Eguide you will find the interface to mail (Exchange) in the same location as the ODBC local uploading that to a server.

Go to the project flow area alternate mouse open.....  What you can access with that is based on the same interface as using that OLEDB/ODBC you can read all those fields/text but not the attachments.   No problem as you are needing the header.    
Exchange can be seen as a dataprovider with JET or othersHow to retrieve Exchange and Outlook data with the Jet 4.0 OLE DB provider in Access 2000" title="ht...

https://technet.microsoft.com/en-us/library/ms191461(v=sql.105).aspx   Looks weird but see also: http://support.sas.com/resources/papers/proceedings13/372-2013.pdf  and http://support.sas.com/resources/papers/proceedings10/086-2010.pdf

Reading mails can be done in a basic pop3 way: http://support.sas.com/resources/papers/proceedings09/002-2009.pdf

On a Unix platform one upon a time SAS was using the UNIX mail client (8.2) With the 9 versions it does it using a direct interface.
That works for sending, although interfaces is behind the market evolvment. As the Unix mail client seldom is used for reading mails I believe you are not after that one. 

http://support.sas.com/resources/papers/proceedings09/002-2009.pdf

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

View solution in original post


All Replies
Super User
Super User
Posts: 7,407

Re: Can SAS Read email inbox ?

I would suggest that this would need to be in the email account, i.e. setup a rule and a VBA macro, i.e. rule = if subject line="Enq: Datamart..." then run macro Export_Text_To_File.

http://stackoverflow.com/questions/11647717/outlook-export-mail-to-text-on-rule-of-vba

Then you can read all the text files in the location you export to.  There are messaging systems out there to do such a thing.

I don't think straight off you will be able to read the email as they are normally held on IT servers under different accesses.

PROC Star
Posts: 7,363

Re: Can SAS Read email inbox ?

I haven't tried it yet but, if you have Visual Basic ( Free Dev Tools - Visual Studio Community 2013 ), then the following might provide what you need: 25631 - SAS Outlook Data Extractor

Super User
Posts: 6,946

Re: Can SAS Read email inbox ?

In case your email system runs on UNIX, it stores the mails in text files in /var/spool/mail.

If your SAS runs on a UNIX server, I suggest to set up the local mail system on that machine and have your respective mails forwarded to an account there.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Solution
‎04-15-2015 04:14 AM
Valued Guide
Posts: 3,208

Re: Can SAS Read email inbox ?

When you are using Eguide you will find the interface to mail (Exchange) in the same location as the ODBC local uploading that to a server.

Go to the project flow area alternate mouse open.....  What you can access with that is based on the same interface as using that OLEDB/ODBC you can read all those fields/text but not the attachments.   No problem as you are needing the header.    
Exchange can be seen as a dataprovider with JET or othersHow to retrieve Exchange and Outlook data with the Jet 4.0 OLE DB provider in Access 2000" title="ht...

https://technet.microsoft.com/en-us/library/ms191461(v=sql.105).aspx   Looks weird but see also: http://support.sas.com/resources/papers/proceedings13/372-2013.pdf  and http://support.sas.com/resources/papers/proceedings10/086-2010.pdf

Reading mails can be done in a basic pop3 way: http://support.sas.com/resources/papers/proceedings09/002-2009.pdf

On a Unix platform one upon a time SAS was using the UNIX mail client (8.2) With the 9 versions it does it using a direct interface.
That works for sending, although interfaces is behind the market evolvment. As the Unix mail client seldom is used for reading mails I believe you are not after that one. 

http://support.sas.com/resources/papers/proceedings09/002-2009.pdf

---->-- ja karman --<-----
Frequent Contributor
Posts: 85

Re: Can SAS Read email inbox ?

Thanks a lot.. Solved my purpose

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 1718 views
  • 0 likes
  • 5 in conversation