Sending e-mail thru SAS


    Sponsored Links


  • 1. z/OS: delimiter = '05'x
    Life stays interesting! I have a user who got an 'out of resources' error message on PC/SAS and thought: "Well, let me dust off my TSO skills [note: not ISPF, not ROSCOE, TSO!] and take this file up to the mainframe where resources extend to the horizon." well, I have no idea how ftp works but now there is a tab-delimited file on z/OS proc import does not work: "not licensed for z/OS" so user now wants to read his text file with an input statement. After a quick read of the OnLine Doc for the infile page I offered the following kludge: Filename TxtFile '???' DISP=SHR LIBNAME DOSE '???' DISP=SHR; data dose.TestData; drop var2 var4 var6 var8 var10 var12; INFILE TxtFile firstobs = 7 %*skip header records; delimiter = '05'x; %*EBCDIC horiz tab; INPUT var1 var2 var3 var4 var5 var6 var7 var8 var9 var10 var11 var12 var13; bound to * work? * fail? Ron Fehd the occasional z/OS maven
  • 2. Only want values if there are 3 or more
    if I have the following, Now I want to only have the values where Field1 has the same value 3 or more times. How do I count Field1 and say give me the values when its greater than 3? How would I do that? Field1 Field2 A 3 A 5 A 4 B 1 B 7 C 2 D 1 D 2 D 5 D 4 This is the dataset that I need. Field1 Field2 A 3 A 5 A 4 D 1 D 2 D 5 D 4 Thanks!
  • 3. Power and sample size calculation books
    I would commend "Statistical Power Analysis for the Behavioral Sciences", by Jacob Cohen. Great on concepts, theory.

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 63 guest