06-04-2018 06:04 PM
After generating excel files with ods excel and proc report, I used SAS email macro to send out a email with excel files attached. But I couldn't open attached excel files. If I emailed them manually, I can open them.
06-04-2018 06:10 PM
06-13-2018 01:29 PM
***to generate excel file***;
ods excel file="/pro/temp/list.xlsx" style=f304temp startpage=yes bodytitle;
proc report data=list_csv nowd split='*' headline headskip
column ("Center" ccn)("PID" pid) ("Code" ac);
define ccn / display " " style=[just=left cellwidth=1.7in];
define pid/ display " ";
define ac/ display " " style=[cellwidth=0.6in];
ods excel close;
*** to email out the excel file***;
%macro mail7 (dy=2);
%if &ndy = &dy %then %do;
put " ";
put " ";
filename mailout email
subject="List of Patients &tdate"
06-13-2018 01:50 PM
no error info in log file, but When I tried to open attached file, it said "we found a problem with some content in the excel file."
06-13-2018 02:35 PM
Are you sure it happens during the email transfer? It's hard to imagine how sending it in the email could slightly damage a zip-compressed file without completely trashing it.
I'd rather suspect that something in the SAS data messes with the XML structure of the xlsx file.
06-13-2018 02:38 PM
Type: specifies the content type for the message body. If you do not specify any content type, SAS tries to determine the correct content type. You must enclose the value in quotation marks type='content/type' The default value of this parameter is ‘text/plain’.
Can anyone tell me what is the list of "content/type"? thanks
06-13-2018 03:11 PM
The problem has been solved. Just need to point out content type: