Sending e-mail thru SAS


    Sponsored Links


  • 1. copy external file
    Is there a way to make a copy of an external files from SAS (without using SYSTEM or X)? I want to "proc import" an excel file even if the user already has it open. The idea is to first copy it to C:\temp (OK not very portable...) and then "proc import" the copy. I can do it with "system" and the noxwait option, but that pops up that ugly window, very distracting. I see I can do things like rc=rename('d:\temp','d:\testfile','file'); but is there an equivalent for "copy"? I can't find it anywhere! Any help would be greatly appreciated! Paul
  • 2. PROC Panel
    Hi all I want to use proc panel command. Can some one tell me whether the experimental panel is windows based or linux based? Regards Ruchi
  • 3. A question about the array of macro variables
    Dear all: I have a question that how to create an array of macro variables. Is it possible? If yes, how to use it? BR, Minze
  • 4. Possible not to print log?
    Hi all. I don't want to print the log. Is that possible? Thanks. Renata Matos

Sending e-mail thru SAS

Postby » Fri, 01 Aug 2008 21:43:11 GMT


I want to send e-mail thru SAS, but my outlook is not configured in
I do want to send the mail with out configuring the outlook, is there
any way?

Please give the setting needed in the SAS.

I'm successful with the computer where the MS Outlook is configured.

Thanks in advance.

Sukumar Baluswamy

Re: Sending e-mail thru SAS

Postby anindya.lugbang » Fri, 01 Aug 2008 22:01:46 GMT

filename mymail email from="<your email id>"
                      to="<to email id>"
                      subject="Put Subject Here"
                      content_type="text/html" emailsys=smtp
emailid="logon id" emailpw="password";
data _null_;
   file mymail;
   put 'hello world';

On Thu, Jul 31, 2008 at 6:13 PM,  XXXX@XXXXX.COM 

Re: Sending e-mail thru SAS

Postby anindya.lugbang » Fri, 01 Aug 2008 22:04:21 GMT

More info -  http://www.**--****.com/ 

On Thu, Jul 31, 2008 at 6:31 PM, Anindya Mozumdar

Similar Threads:

1.Sending email from and to SUGI-mail account

Hi friends,

I just tested sending email from my SUGI account ( XXXX@XXXXX.COM ) to my home one again and now it worked! So the accounts are reachable from and to outside. But a testmail to SAS-L failed as I am not subscribed with that account.

Regards from an overwhelming impressive conference - Jim.

2.Formatting email body when sending email from a z/OS system

All information in and attached to the e-mail(s) below may be =
proprietary, confidential, privileged and otherwise protected from =
improper or erroneous disclosure.  If you are not the sender's intended =
recipient, you are not authorized to intercept, read, print, retain, =
copy, forward, or disseminate this message.  If you have erroneously =
received this communication, please notify the sender immediately by =
phone (704-758-1000) or by e-mail and destroy all copies of this message =
(electronic, paper, or otherwise).  Thank you.

I am having an issue when I send emails from my z/OS system using PUTs
in a DATA step.  My file definition is
FILENAME techserv EMAIL                                          =20
         TYPE=3D'text/html'                                        =20
         TO=3D(' XXXX@XXXXX.COM '                               =20
            )                                                    =20
         FROM=3D' XXXX@XXXXX.COM '                              =20
         SUBJECT=3D"Jobs running high CPU compared to Wall Clock"  =20
         ;                                                       =20

And my DATA step looks like
DATA _NULL_ ;                                                    =20
  FILE techserv ;                                                =20
  PUT "This is a list of jobs with programs that should be   ";  =20
  PUT "investigated.                                         ";  =20
  PUT "                                                      ";  =20
  PUT ;                                                          =20
  PUT "The programs in the jobs are running at least         ";  =20
  PUT "&display_wall. hours and are consuming at least       ";  =20
  PUT "&display_pct. CPU of a single engine.                 ";  =20
  PUT "                                                      ";  =20
  PUT ;                                                          =20

But the email message body looks like
This is a list of jobs with programs that should be investigated. The
programs in the jobs are running at least 0:15 hours and are consuming
at least 80% CPU of a single engine.

Can someone tell me what I'm doing wrong and point me to where I can
learn more?

Jim Horne
ITE-Large Systems & Messaging
Lowe's Companies, Inc.

3.Send e-mail through SAS and REXX.

Hi SAS'ers 

        I wish to send e-mail through SAS. So, i developed a REXX
Panel where i can supply all the Mail-ids and the Message. Now through
SYSPARM, i am not able to pass all addresses because it has a
restriction that we can only pass upto some maximum length through a

So finally decided that, let Rexx program write all the the Id's and
the Message to a Output File so that this can be used as an Input to
my SAS program in the next JCL Step.  So i came up with a SAS program
like below that reads the file.

Input File containing the Id's and Messages: 

Hello dear, 
        Pls help me to succeed in sending mails to 
my dear ones through SAS; 

So, all the string appearing inbetween the lines To: and CC: needs to
be concatenated into another new field say, TOIDS. Same way for the
another fields CCIDS. But for messages, i will save each line in one
temporay variable until EOF.
In Rexx,, its quite easy to implement the above logic, but is it
possible to do the same way in SAS.

The SAS Program follows here, but i'm not able to run it

  %LET array todata (5) $ todata1-todata5;        /*Unable to declare
Arrays  globally, it gives error */
  %LET array ccdata (4) $ ccdata1-ccdata4;        /*Unable to declare
Arrays  globally, it gives error */
  %LET array msgdata (2) $ msgdata1-msgdata2;      /*Unable to declare
Arrays  globally, it gives error */
 data r ;
  retain i 1; 
  retain j 1; 
  retain k 1; 
  retain type 1; 
  infile mailfile; 
  input   inrec;       
  if inrec = 'To' then  type = 1; 
  else if inrec = 'CC' then type = 2;   
  else if inrec = 'Message' then type = 3;
  if type = 1 and inrec NE 'To' then;         
        todata (i) = inrec;
else if type = 2 and inrec NE 'CC' then; 
        todata (j) = inrec;
else if type = 3  then 
              msgdata(k) = inrec; 
data getarr;  /*The arrays todata(), ccdata() and msgdata() should be
accessible here*/
RETAIN TOIDS _CHARACTER_;  /*How to initialize it here, since this is
a variable length*/
RETAIN CCIDS _CHARACTER_; /*How to initialize it here, since this is a
variable length*/
do i= 1 to 5; 
   TOIDS =  TOIDS || ' ' || todata(i); 
TOIDS = strip(TOIDS); 
do j= 1 to 4; 
   CCIDS = CCIDS || ' ' || ccdata(j); 
CCIDS = strip(CCIDS); 
do while msgdata(k) NE ' ' 
       put 'msgdata(i)'; 


I have given comments wherever it errored out. Please update me how to
solve these errors.

Alternatively, i tried even interacting SAS with REXX execs, but i was
getting some problems while executing. Can you tell me what changes
needs to be done inorder to make it work. This message is somewhat
longer as i need to post the entire program with input dataset and i'm
extremely sorry for that!.

Thanks in anticipation.

4.Send a mail with SAS

Hello everybody,

Is someone know how to send a mail with a programm SAS. The mail may
contain some sentence in bold, in color and underligned.



5.Sending mail with SAS

Hello SasUsers,

How to send a mail via SAS with the result ODS HTML directly in the
body of the mail.

Thanks. Ash007.

INPUT X1 X2 X3 X4 X5 $; CARDS;
2 5 5 1161 ABIEN
35 6 3 1336 ALMIC
82 1 5 1499 ANIEL

filename mm email
	to 				= " XXXX@XXXXX.COM "
	from 			= " XXXX@XXXXX.COM "
	subject 		= "test email formate"
	type 			= "text/html"
	content_type 	= "text/html";

ods html body = mm style = styles.default rs = none ;

proc print data = TABLE_BIDON; run;

ods html close;

6. Sending an E-Mail using SAS

7. Sending emails via Outlook from SAS but a security Yes/No box appe

8. Sending email from SAS using Gmail account

Return to sas


Who is online

Users browsing this forum: No registered users and 33 guest