Extracting CSV email attachments into SAS

Accepted Solution Solved
Reply
Contributor
Posts: 26
Accepted Solution

Extracting CSV email attachments into SAS

Hi,

 

I have in the past used SAS functionality to send emails from SAS with an attachment via Outlook automatically. Is it possible to extract attachments from emails in Outlook into SAS? If so, please could you point me into the right direction on how to learn more about it?

 

Thanks


Chris


Accepted Solutions
Solution
2 weeks ago
Esteemed Advisor
Posts: 6,685

Re: Extracting CSV email attachments into SAS

[ Edited ]

Since you need to do a base64 conversion on the attachment, you will have to use external tools for that. In SAS you'd be limited by the maximum size of a character variable (32767), so the internal functions/formats would be useless for most files.

 

You can use SAS to extract the base64-encoded MIME parts from the HTML stream (as that is pure text), and then run the external utility against the parts to create the real attachment files.

 

The best solution is to avoid mail attachments for data transfer altogether. Retrieving data from URLs or FTP sites is comparatively easier in SAS.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Solution
2 weeks ago
Esteemed Advisor
Posts: 6,685

Re: Extracting CSV email attachments into SAS

[ Edited ]

Since you need to do a base64 conversion on the attachment, you will have to use external tools for that. In SAS you'd be limited by the maximum size of a character variable (32767), so the internal functions/formats would be useless for most files.

 

You can use SAS to extract the base64-encoded MIME parts from the HTML stream (as that is pure text), and then run the external utility against the parts to create the real attachment files.

 

The best solution is to avoid mail attachments for data transfer altogether. Retrieving data from URLs or FTP sites is comparatively easier in SAS.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 26

Re: Extracting CSV email attachments into SAS

Thanks very much for your thoughts

☑ This topic is SOLVED.

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

Discussion stats
  • 2 replies
  • 84 views
  • 1 like
  • 2 in conversation