The SAS Output Delivery System and reporting techniques

EMail from MVS with CSV file as XLS

Reply
N/A
Posts: 0

EMail from MVS with CSV file as XLS

Hi ,
Can you please guide to send an e-mail with the attachment? The attachment should be the XLS from the space separated MV'S(mainframe) file.
I tried with option EXT="XLS" in the ATTACH. But the attached spread sheet came with full record in the cell.

Thanks,
Selvi
SAS Super FREQ
Posts: 8,743

Re: EMail from MVS with CSV file as XLS

Hi,
Have you tried CSV as the EXT value??? Most windows-based systems have CSV registered to Excel. When I email myself a CSV file, Excel launches when I click on the file, even if it is named CSV. I was not able to test this code equivalent on the mainframe. However, if you contact Tech Support, they can help you figure out how to make similar syntax work on the mainframe.

cynthia

This syntax worked for me and Excel opened the when I clicked on the CSV attachment -- the information displayed in the correct columns:
[pre]
ods csv body='c:\temp\table2.csv';

proc tabulate data=sashelp.shoes;
var sales;
class region;
table region all, sales*(min mean max);
run;

ods _all_ close;

filename doemail email to='person1@isp.net'
from='Cynthia@sas.com'
cc='cynthia@sas.com'
subject='Testing attach of csv'
attach='c:\temp\table2.csv';
data _null_;
file doemail;
put 'this is a test with csv attachment.';
run;
[/pre]
N/A
Posts: 0

Re: EMail from MVS with CSV file as XLS

We regularly send out CSV files from the mainframe and use EXT=”CSV”.

However, I am intrigued by your space separated XLS file as ODS is used in this context for comma separated variables (hence CSV).
N/A
Posts: 0

Re: EMail from MVS with CSV file as XLS

you have to help excel understand your data.
Excel does not expect "space separated data" so thinks a line without a delimiter will belong in one cell.
By default excel assumes CSV uses a comma separator.
However, you need not consider this issue.
Use the ODS CSV destination to fill your data file.
Apart from using more cpu time than I think it needs, it does provide an effective way to create data for Excel.
If you might like cell formatting, try the ODS destination tagsets.excelxp.

Good Luck

PeterC
Ask a Question
Discussion stats
  • 3 replies
  • 701 views
  • 0 likes
  • 2 in conversation