5月 012009
Contributed by Richard Foley, Product Manager, SAS

Twitter, a microblogging platform, has become all the rage. Companies are using Twitter to inform and market to customers and the world. People use it as a way to keep in touch and let others quickly know what they are thinking and where they are. Visit Twitter at twitter.com.

Wouldn’t it be cool to use SAS as your Twitter information hub? Post twitter updates, called tweets, from SAS; have SAS query Twitter and then load the results into SAS datasets for further analysis.

Twitter’s API uses Web Services to allow clients, such as SAS, access to the Twitter functions. Typically you find two different types of Web Services, a SOAP style Web Service and a RESTful style Web Service. (I won’t go into the differences, but have provided links for reference.) SAS 9.2 has two new procedures to handle these services:

  • PROC SOAP for SOAP style Web Services
  • PROC HTTP for RESTful style Web Services.

Twitter has a developer API Wiki that describes the various operations available to the public along with the parameters required when invoking these methods. To follow along with this example, you'll need a Twitter username and SAS 9.2.

According to the Twitter API documentation, we see that many of the API methods require authentication using HTTP Basic Authentication and are REST style services. Therefore, we use PROC HTTP, which supports HTTP Basic Authentication via the two procedure options webusername and webpassword. (HTTP basic authentication passes your username and password. If you're overly concerned about securing your account you shouldn’t use HTTP basic authentication; HTTP basic authentication can be intercepted and reused or broken, giving someone else access to your account.)

Refer to the Twitter API to find out how to update our status. We see that we need to call the URL http://twitter.com/statuses/update.format where format is either xml or json. We want XML in this case, so we'll use the URL http://twitter.com/statuses/update.xml. The method or HTTP verb that's required for this particular operation is POST because we're updating data (many other Twitter API functions only retrieve data and therefore use a GET operation). The one parameter we really need is the status parameter that contains our update. So let's look at our SAS code to see how this is done.

A SAS developer Zach Marshall was the first to use the Twitter API and here is the code he developed for tweeting on Twitter.

filename twtIn "\\sas\status_update.txt";
filename twtOut temp;
%let proxyhst="myproxy host"
%let twUser="mytwitterusername";
%let twPass="mytwitterpassword";
proc http

where \\sas\status_update.txt is the text you will be sending to Twitter.

Let’s use Zach’s code as a template and go one step further; query Twitter and put the information into SAS.
Continue reading "Using SAS to call Twitter"
4月 302009
Social media and community experts write tomes full of advice for how to foster conversations with and between your customers. The best advice is "be where they are." In other words, have the conversation in a place where your audience already hangs out. Sometimes that means participating in a community where your customers are already engaged. Sometimes that means creating an environment for them where they can share ideas and problem solutions. And in many cases, it means doing both.

We created forums on support.sas.com because we know that many customers visit the site to learn about SAS or to solve problems with their applications. We started with five forums that addressed hot topics at the time. Since then, you have requested forum topics and we've done our best to launch them. We also launched forums that we thought would address topics on the horizon. (See the graph at the end of this post for a glimpse of forum usage in March and April.)

Forums that are arriving

At your suggestion, we launched a general SAS Procedures forum in February 2008. This forum has been very active; generating 900+ threads in just under a year. We took a look at what was posted and decided to split this forum into two. The new forum, SAS Statistical Procedures was launched at the beginning of April 2009. It focuses on questions, experiences, and best practices for using SAS statistical procedures. We hope that the new forum enables you to use your forum time wisely and to target your posts to the right audience.

Because the existing procedures forum contained many posts that focused on the statistical procs, we moved 13 posts into the new forum to get it started. One of the great new posts comes from a SAS user plf515. He offers four quick steps for writing a good post, which in turn gets you a better answer. These guidelines apply for all posts, so take a look at How to ask a statistics question.

In addition to the SAS Statistical Procedures forum, we also launched the SAS/IML and SAS/IML Studio forum. Hutch@sas says that the forum is "designed to serve users of SAS/IML and SAS/IML Studio (formerly known as Stat Studio). We hope you will use this forum to interact with other users, posing questions and contributing your opinions about programming features and best programming practices." His two introductory posts provide some overview information about SAS/IML and SAS/IML Studio. These are great posts to read even if you don't use the IML language to perform advanced analytics.
Continue reading "Forums Come and Forums Go"
4月 282009

SAS V9.2 釋出已經有一段時間,雖然仍舊有很多學校機關沒有升級到最新的版本,而仍舊沿用 V9.1.3,不過我已經用新版差不多快四個月的時間,所以之後會慢慢來介紹 V9.2 的新功能。這篇技術文件首先是來介紹新版的 proc power 以及 proc glmpower 所帶來的新的功能。

Continue reading »
 Posted by at 4:44 上午
4月 282009

SAS V9.2 釋出已經有一段時間,雖然仍舊有很多學校機關沒有升級到最新的版本,而仍舊沿用 V9.1.3,不過我已經用新版差不多快四個月的時間,所以之後會慢慢來介紹 V9.2 的新功能。這篇技術文件首先是來介紹新版的 proc power 以及 proc glmpower 所帶來的新的功能。

Continue reading »
 Posted by at 4:44 上午
4月 242009
You can read the forums by visiting support.sas.com/forums, you can subscribe to any or all forums via RSS (look for the orange icon on the page), or you can set a watch that will deliver forum content to you via e-mail.

To set a watch, you must first login to the site. To watch a forum or thread, navigate to the appropriate forum page. The list of items will contain either Watch Forum or Watch this Thread. Select the link.

You can create customized watch settings, such as the frequency with which you receive email. To customize your settings:

  1. Make sure that you are logged on to support.sas.com.
  2. Select Your Control Panel from the list at the top right of the forums page.
  3. Select Your Watches from the Your Control Panel box.
  4. Select the settings that fit best with your reading and work habits.
  5. Select Update.

You must create a forum ID before you can post. You will be promoted to create this ID. It is the name that appears next to your post. You can decide how much to reveal about yourself in this name. All SAS posters have names that end in @sas. SAS employees posting for JMP, have names that end with @jmp.

Updated April 23:
Notify me when there is a response to my post
If you find that watching your posts is taking more time than you want to spend with forums, this tip is for you.

  1. Make sure that you are logged on to support.sas.com.

  2. Select Your Control Panel from the list at the top right of the forums page.

  3. Select Your Watches from the Your Control Panel box.

  4. Select Yes for the first question and maybe the second:

    Always watch threads I create
    Always watch thread I reply to

When you turn on this setting, answers to your questions will appear in your email inbox on the schedule you specifiy.

4月 232009
For a rather long time I have been talking of the convergence of text-related technologies such as search, text mining, text analytics, machine learning, voice analysis, video mining, enterprise content management (ECM), business intelligence (BI) and business analytics (BA) etc. The industry continues to change with the merger of three text analytics companies into one this week.

To me, this merger serves to validate SAS' direction in the unstructured space where our strategy is to take unstructured data right across the platform so organizations can have access to the full depth and breadth of SAS capabilities with a complete range of tools, products and solutions.

Some day users will not consider text to be any different from standard structured database fields. Analytic applications will automatically roll up text and other unstructured information.

IT departments and Business Reporting users no longer need be restricted to partial views on limited data. Data sources in the future can be gathered from Tweets, emails, dynamic web 2.0 sources and then integrated with the traditional IT data warehouses before they are cleansed and analyzed rigorously -- resulting in better decisions and greater impacts. SAS is ready to assist you in this exciting journey – and we applaud those who see the necessity of integration across the IT Storage, Analytics , reporting and line of business users.

4月 162009
1. Open the execution plan by the _method option.

proc sql _method;
select adsmsg.*
left join
on adsmsg.msgid=afmsg.msgid

2. Select any row number by monotonic() function in PROC SQL, since _n_ cannot be used in PROC SQL.

proc sql;
select monotonic() as rowno, *
from sashelp.cars
where monotonic() between 10 and 20

3. Check the resource for each statement in PROC SQL

proc sql;
reset stimer;

4. Created a serial of macro variables.

proc sql;
select name into :name01-name19 from sashelp.class;
4月 152009
The Proceedings from SUGI 24 forward are available on support.sas.com. You can browse the table of contents for the Proceedings or search the Proceedings collection by visiting the SAS Global Forum site at support.sas.com/events/sasglobalforum/previous/online.html.

However, you can search all of the papers that are available on support.sas.com, including the Proceedings, from one spot. Try this.

  1. Go to support.sas.com
  2. Type your term or phrase in the search entry field in the top right corner of the page.
  3. Select the down arrow for the drop list, then select Papers.
  4. Select the Search button or hit your Enter key.
The search results include appropriate entries from the Proceedings, all TS Docs, and all technical papers that are available on support.sas.com.

Note: You can also browse our technical papers by visiting support.sas.com/resources/papers and selecting a topic category.

What do you think; is the papers search a useful tool for locating information?
4月 102009
Elisa Priest, a doctoral student in epidemiology at the University of North Texas, was selected as one of nine SAS Student Ambassadors for 2009.

She also won the "Best Contributed Paper" in the Statistics Section.

Her presentation, Easier Exploratory Analysis for Epidemiology: A Grad Student How-To Paper, was very well received. She even made folks laugh several times during her talk!

Priest sited Art Carpenter's macro book in her presentation, and recommended it as a reference. She was thrilled to later have the opportunity to meet Art, and get a photo with Art and Ron Cody!

Originally from Brazil, Priest is a doctoral student in epidemiology, with a focus in chronic diseases and clinical trial design and processes, at the University of North Texas. She completed her bachelor’s degree in molecular and cell biology at Texas A&M University.

Eight years ago, Priest first used SAS while completing her master’s in community health at the University of Texas. She is most familiar with Base SAS® and SAS/STAT® software and is a SAS Certified Professional in SAS Base Programming. Priest has presented at several South Central SAS Users Group (SCSUG) conferences and epidemiology conferences.

She authored a book chapter on obesity and inflammation and has published several articles in epidemiology and chronic disease journals, including Contemporary Clinical Trials and Arteriosclerosis Thrombosis and Vascular Biology.
She plans to continue supporting clinical trials and teaching efficient clinical trials design and methods after graduation. During SAS Global Forum 2009, Priest learned many SAS tips and tricks that she’ll take back to her fellow students.
4月 022009
Maura Stokes works in the Statistical Applications Department in Advanced Analytics at SAS. Maura is also a member of the review board for support.sas.com. She works hard to provide you the information that you want as well as the statistical features that you need in our products. Let me introduce you to Maura.

What do you do:

I’m the development product manager for SAS/STAT® software, and I also coordinate some division-wide activities such as our documentation process.  Since SAS/STAT now includes 75 procedures and requires nearly 8,000 pages of documentation, obviously it takes several people to manage it. I keep current with statistical methodology being developed and adopted, obtain feedback from customers, and help to decide on priorities for future development. My role also includes outreach, and I give talks to both SAS user groups and statistical groups about our statistical software.  I also represent the analytical interests in SAS Global Forum planning and coordination, as well as support.sas.com, where I manage the Statistics and Operations Research focus area on support.sas.com.  I’m also the lead author of the SAS Press book Categorical Data Analysis Using the SAS System.

What’s the most interesting part of your job?

Learning new statistical methodology is still probably the most fun for me.  We occasionally bring in area experts for seminars to jump-start us in new areas, and that’s always invigorating.   

Continue reading "Meet Maura Stokes of the Advanced Analytics Department at SAS"