If the attached files aren't self-explanatory enough, e-mail me off-list for
further information
%Macro EmailDEF(To=Default,Subject=Default); 00010002
%NOTE(Macro EmailDef: parameters To="&To" Subject="&Subject") 00020006
FileName XXX Email 00030002
From = "[EMAIL PROTECTED]"
00040000
%If "&To" EQ "Default" %Then %Do; 00070009
To = "[EMAIL PROTECTED]"
00060000
%End; %Else %Do; 00140002
To = "&To" 00150002
%End; 00160002
Replyto = "[EMAIL PROTECTED]"
00100000
00200002
%If "&Subject" EQ "Default" %Then %Do; 00210009
Subject = "Output from Job &SYSJOBID" 00220002
%End; %Else %Do; 00230002
Subject = "&Subject" 00240002
%End; 00250002
%Mend; 00260002
%Macro EMAILON(Message=HTML,To=Default,Subject=Default) ; 00010002
%If "&Message" = "PDF" %Then %Do; 00020000
* With PDF all we have to do is define the file; 00030008
ODS PDF File="&HFSPath.&SYSJOBID..pdf" ; 00040000
%End; %Else %IF "&Message" = "HTML" %Then %Do; 00050001
* With PDF we must define an email as well as the file; 00060008
%EmailDEF(To=&To,Subject=&Subject) 00070006
Type = "Text/HTML" ; 00080004
ODS HTML Body=XXX RS=None STYLE=Minimal ; 00090004
%End; %Else %Do; 00100001
%NOTE(Macro EMAILON: Message Parameter "&Message" wrong) 00110006
Abort Abend; 00120001
%End; 00130001
%Mend ; 00050000
%Macro EmailOff(Message=HTML,To=Default,Subject=Default); 00010003
%If "&Message" = "PDF" %Then %Do; 00020001
* With PDF we must close the file, define an email, and attach it ;00030002
ODS PDF close ; 00040001
%EmailDef(To=&To,Subject=&Subject) 00050002
Attach=("&HFSPath.&SYSJOBID..pdf" 00060002
ct="application/pdf" ext="pdf"); 00070002
Data _NULL_; File XXX; Put "Please see the attached file."; Run;00080002
%End; 00080002
%Else %If "&Message" = "HTML" %Then %Do; 00100001
* With HTML all we have to do is close the file ;00110001
ODS HTML close ; 00120001
%End; 00360007
%Mend; 00140001
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html