Send As SMS

Wednesday, January 24, 2007

Sending a page or text message from SAS

You might have occasion to send a page or a text message from a SAS program. That's easy to do if you know the email address used by the paging carrier. You can usually get this information on the carrier's web page. For example, the address used for Verizon Wireless pagers and cell phones is number@vtext.com. There's a list of the major carriers and their gateway addresses at . You have to set some system options before starting SAS if you want to use the email engine (I'm not sure why this has to be done at invocation, but it does). Here's a fragment of my sasv9.cfg file:
-emailsys smtp
-emailhost smtp.mail.yahoo.com
-emailid kd6ttl@yahoo.com
-emailpw xxxxx
-emailauthprotocol login
Here's code I could put in my SAS program:
filename textmsg email '9999999999@vtext.com' 
         subject='Program notification';                               
                           
                                                                       
                                                                
data _null_;                                                           
                                                                
   file textmsg;                                                       
                                                                
   put 'Program ABC completed';                                        
                                                                
run; 
A few seconds after I run this program (with a real phone number and email password, of course), the message appears on my cell phone. I've used a similar technique to send messages to a pager. There are some cautions, of course. A logical place to put this code would be in the TERMSTMT system option under version 9, but if something sufficiently bad happens the termination code will not be executed. It's always possible that the mail system or your internet connection is out of service. And not all pagers handle lower case letters correctly, so this is one of the very rare cases when it's ok to put text in ALL CAPS.

0 Comments:

Post a Comment

<< Home