I have exported sas-dataset, copied to my computer using WinSCP and opened it succesfully.
However, when I sent the file using data step, the file is corrupted. I click the file in Outlook and Excel says "The workbook cannot be opened or repaired by Microsoft Excel because it it sorrupt".
What can I do to make the file openable using data step e-mail.
My code:
/* Create data */
data A;
input B;
datalines;
1
;
run;
/* Export */
proc export
data=A
dbms=xlsx replace
outfile="/home/USERNAME/xlsx_export";
run;
FILENAME Mailbox EMAIL 'user.name@abc.de'
Subject='xlsx_test'
attach="/home/USERNAME/xlsx_export.xlsx";
DATA _NULL_;
FILE Mailbox;
PUT "xlsx test";
RUN;