The SAS Output Delivery System and reporting techniques

Sending email with attachment from Mainframe SAS

Frequent Learner
Posts: 1

Sending email with attachment from Mainframe SAS

Hi Team,

I am facing issues with SAS Email utility when the attachment size is crossing 10 MB. 


The data(xml coding) is in Mainframe dataset and I am sending it to the receipients email using Email utility. I am using EXTENSION='xls'. Due to the large size of the file, the job is failing to send an email. 

When I downloaded the file manually and did SAVE AS .xlsx, its size reduced considerably. 


Is there any way to send the mainframe dataset with .xlsx extension as email attachment?


I have seen couple of posts which were talking about some macro. The macro uses Vbscript and do the conversion in Windows folder. I am not sure whether that will help for mainframe dataset as well. 


Please help...




Super User
Super User
Posts: 7,401

Re: Sending email with attachment from Mainframe SAS



There is another discussion from today on the subject of sending Excel files via email.  Simply put, Excel is not a good medium for data transfer, nor is email which is limited in size and not secure.  I would advise you to investigate proper data transfer formats - XML, CSV, XPT etc. and validated, secure methods of shipping data such as SFTP, secure portal, secure messaging, databases etc.

Super User
Posts: 6,936

Re: Sending email with attachment from Mainframe SAS

Do you send data or do you send a report? Data is better sent with a minimalist file format like CSV. If you have a report with formatting (eg using ODS TAGSETS.EXCELXP), then you might try to reduce the file size by compressing, if such a tool is present on your mainframe.

.XLSX is basically XML compressed with a zip algorithm. That's why your manually created xlsx was so small.

Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 10,500

Re: Sending email with attachment from Mainframe SAS

Our IT department has at times set some sever limits on email accounts. That file would not have been sent because under those settings the total size of a users email mail-box would be exceeded. You might want to check with your IT staff if you are running into a similar situation.

Ask a Question
Discussion stats
  • 3 replies
  • 4 in conversation