Date: Tue, 27 Apr 2004 18:49:20 -0400
Reply-To: Don Stanley <don_stanley@PARADISE.NET.NZ>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Don Stanley <don_stanley@PARADISE.NET.NZ>
Subject: Re: automatically send email via sas code
You can only attach external files, not SAS datasets. Attachments work fine
using external files.
save your output window first eg ...
proc printto print='c:\output_window.txt' ; run ;
ods exclude all;
proc corresp data=q1_promos_date observed dim=1 ;
tables new_date,toss_promo_code;
ods output observed=sums ;
run;
ods select all;
proc printto print=print ; run ;
then use 'c:\output_window.txt' as your attachment.
As for the SUM dataset, you referred to the name of the dataset in SAS,
just use the operating system name instead. In windows this would be
%let attachment=%sysfunc(pathname(work))\sum.sas7bdat ;
then use &attachment in the email.
filename mymail email 'lkaskey@tracfone.com' subject =
'x_rpt_redemption_complete'
attach = ("&attachment" "c:\output_window.txt") ;
Don
On Tue, 27 Apr 2004 18:19:51 -0400, Larry Kaskey <LKaskey@TRACFONE.COM>
wrote:
>Can someone help with this...I am trying to send email of a file via SAS
>code. Here is what I have...
>
>ods exclude all;
> proc corresp data=q1_promos_date observed dim=1 ;
> tables new_date,toss_promo_code;
> ods output observed=sums ;
> run;
> ods select all;
>
>
>
>filename mymail email 'lkaskey@tracfone.com' subject =
>'x_rpt_redemption_complete'
>attach = sums;
>
>
>
>data _null_;
>file mymail;
>run;
>
>
>The log shows the following error...note that "sums" is output normally.
>
>
>
>ERROR: Error opening attachment file SUMS.
>Message sent
> To: "lkaskey@tracfone.com"
> Cc:
> Subject: x_rpt_redemption_complete
> Attachments: SUMS
>
>I actually would like to send the contents of the output window as well.
>
>Thanks in advance!
>
>Larry Kaskey