BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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
3 REPLIES 3
Cynthia_sas
SAS Super FREQ
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]
deleted_user
Not applicable
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).
deleted_user
Not applicable
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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1711 views
  • 0 likes
  • 2 in conversation