EG: 7.15
EG Program creates an Excel file on UNIX SAS Grid.
When attached to a EG Generated email the attachment (email generation is fine) is corrupt and can not be opened.
User gets the 1st warning message then the 2nd MS noted file corrupt message.
When moved (FTP) to local desktop the Excel file opens fine.
Any thoughts... TIA
Here is the EG SAS Code...
/* Setting up email routine to email the Excel to the users */
/******************************************************************/
FILENAME mymail EMAIL
Attach = '/xx/xx/Metric_ReWrite/Acctname_Metric_MatchStatus.xlsx';
RUN;
DATA _null_;
FILE mymail;
PUT "!EM_TO! (&NOTIFY.)";
PUT "!EM_CC! (&NOTIFYCC.)";
PUT "!EM_REPLYTO! (&REPLYTO.)";
PUT "!EM_SUBJECT! Testing Email Of Client Master List VS Master_New (File From UNIX SAS GRID)";
PUT " ";
PUT " *** Testing to see if the Excel is still corrupt *** ";
PUT " ";
PUT "** Confirm Attachment: Acctname_Metric_MatchStatus.xlsx";
PUT " ";
PUT " ";
PUT "<EOF> End Of Testing <EOF>";
PUT " ";
RUN;
After digging around this nice simple code worked...
Thanks, Jay
filename outbox email
from='abc@abc.com'
to='abc@abc.com'
type='text/html'
subject='Test Mail'
attach=("/user/test.xlsx" content_type="excel");
ods html body=outbox rs=none style=Htmlblue;
proc odstext;
p 'Hello,';
p ' Please find the attachment';
p 'Thank You';
title;
run;
ods html close;
Added the code, seems to include another file as an attachment, that is not an excel file.
It's odd as the new file has part of the email message in the file.
I have to open in Notepad to read it...
Still digging, thanks.
Jay
After digging around this nice simple code worked...
Thanks, Jay
filename outbox email
from='abc@abc.com'
to='abc@abc.com'
type='text/html'
subject='Test Mail'
attach=("/user/test.xlsx" content_type="excel");
ods html body=outbox rs=none style=Htmlblue;
proc odstext;
p 'Hello,';
p ' Please find the attachment';
p 'Thank You';
title;
run;
ods html close;
Why are you sending an HTML file but pretending it is an XLSX file?
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: