Tag: data

Summarization in CASL

Summarizing numeric data is an important step in analyzing your data. CASL provides multiple actions that generate summary statistics. This blog provides a quick overview of three of those actions: SIMPLE.SUMMARY, AGGREGATION.AGGREGATE, and DATAPREPROCESS.RUSTATS.

Summarization in CASL was published on SAS Users.

Read sas7bdat files in R with GGASoftware Parso library

… using the new R package sas7bdat.parso. The software company GGASoftware has extended the work of myself and others on the sas7bdat R package by developing a Java library called Parso, which also reads sas7bdat files. They have worked out most of the remaining kinks. For example, the Parso library reads sas7bdat files with compressed […]

SAS Code: Simple Macro to Benchmark Data Performance

When troubleshooting data performance problems, IO problems, or simple library connectivity, I use a simple snippet of code to push the data storage to the limits.  It is useful because it stresses the data storage component, whether it be a SAS dataset on local file storage or an external database like Oracle, and it provides useful performance metrics.  To make it even better, since this is a SAS Macro it can easily be called multiple times for different libraries by setting the 2 parameters in the %BENCHMARK() macro.   Data Benchmark Macro Code The following code will take the CLASS dataset from the SASHELP library and continually append a specified number of iterations.  Be sure to include the OPTIONS statement to get the vital statistics in the log. [crayon-502242bf5ab3d/]   Output This is the output produced when the FULLSTIMER option is set.  These statistics were produced on my laptop with a solid state drive. NOTE: DATA statement used (Total process time):    real time 15.08 seconds    user cpu time 13.55 seconds    system cpu time 1.45 seconds    memory 414561.92k    OS Memory 439844.00k    Timestamp 08/01/2012 11:00:11 PM How fast can you run this code?  Remember to set […]

Business Intelligence: Good Things to Share!

I have been very busy in the past month writing guest post for some of the different blogs that I follow and find interesting.  I’ve also been reading some books that I wanted to share with you! Blogging! Blogging! and More Blogging! Here’s some of the guest posts that I have contributed around the web.  Password Encoding with SASPaul Homes writes the most incredible blog (Platform Administrator) for SAS system administrators.  I was honored when he asked me to contribute to his blog – considering I’m nowhere near the powerhouse of administration knowledge he is. However, I did have one tip about how to encode your password and use it in SAS programs or SAS Enterprise Guide profiles.   User Conferences = Busy SummerWaynette Tubbs seems to be the social media face for SAS.  Her blog about the SAS User Groups always has a few gems.   She asked to reprint one of my other blog posts about the conferences I’m planning to attend this summer. I did appreciate that folks who have already contacted me to let me know I would be seeing them in Milwaukee, London, and Long Beach.  Woot! Woot!  [Make sure you follow Waynette on Twitter – @waynettetubs]  […]

SAS Enterprise Guide: Writing Code to Capture New Twitter Followers

While at the SAS Global Forum, someone said to me – “You cannot write code in SAS Enterprise Guide.”  It was a little shocking to me that the person thought SAS Enterprise Guide was all wizards, flow diagrams, and magic. After talking to a few other folks I have found that it is a common myth.   News Flash!  You can just code in SAS Enterprise Guide!  Today I’ll show you how I pull data from Outlook into SAS Enterprise Guide to create a tweet.  And I’m just going to code. Mythbuster! You can Code in SAS Enterprise Guide If you tweet a lot then you might be familiar with the #FF hashtag. It means people the Tweet-er suggests that you follow. Lately I have been getting more Twitter followers and some I think are really worth checking out.  However, trying to cut and paste all the names into a tweet is a buzz kill.   Here’s how I automated my process with SAS Enterprise Guide.  By the way – if you think I could add some efficiency to my code – speak up in the comments (with examples please!)  Step 1: Setup a MS Outlook Rule Here’s the initial process: […]

SAS EG 5.1 – Data Exploration Feature

I really dig the SAS Enterprise Guide 5.1 – Data Explorer Tool.  How many times have you received a new data set that you know nothing about? While it’s not like it takes forever to run some PROC FREQ/MEANS – but what if it’s already done for you or can be done quickly?  Did that get your attention? Here’s how to use this new feature with your data.   Open Data Exploration from File Menu From the File menu, select Open > Data Exploration.  Then navigate to the dataset you want to open.  I am using SASHELP.SHOES since many of you may already be familiar with it. The dataset is open and a new window appears to the right side of the dataset. At the bottom of the window, you can view some general information about the dataset (i.e. 395 rows and 7 columns). All the Statistics You Can Handle This is what I really like – I can run all statistics for all variables at once.  From the new window, click the Charts icon and then Click to run all statistics. Notice when I selected the Charts icon, the window changed to list each variable type (character, numeric, currency) […]

SAS Enterprise Guide: Import Odd Spreadsheet Data

Perhaps you took my advise a few weeks back and took advantage of the amazing (trumps blare!) SAS Enterprise Guide ability to import MS Excel spreadsheets.  However, if your spreadsheet is a little different – then you may run into some issue when you go to import it.  For instance, look at this import:  Oh it’s so horrible – the columns names are not there and it’s going to be a lot of work to clean it up. Urgh .. it’s giving me a bad day already.  Looks like the default approach to importing this spreadsheet didn’t work out as well. Curses – there must be a better way! Your Data Needs Some Special Lovin’ So let’s look at a spreadsheet similar to the one imported above.  You’ll notice that the actual data I want starts on row 3 not on row 1 as the default import would like.  So row 3 contains the column labels and row 4 contains the data. When you go with the default…  If I go with the defaults and select First row of range contains the field name – the Import wizard default assumes row 1 is where I want to start.  Basically when […]

Using SAS to Automatically Forecast

In honor of Easter, here’s a rare egg for the BI Notes blog – information about SAS statistical products! Today guest blogger Phil Low offers some insight about some of the other SAS procedures, particularly those used for the forecasting. Would You Manually Forecast 60,000 Data Items? Ever wake up to find you have to produce forecasts for 60,000 different items? As a data analyst for a medical supply distributor, I have. Manual forecasting under these conditions is neither feasible nor profitable. Enter the FORECAST and ESM procedures. These two procedures combined can produce more than 10 different forecast models to choose from, and can easily be compared against each other with goodness of fit stats. The FORECAST procedure was written in the 1980s and is a simple auto regression with or without trend. Stepwise selection is used to determine which autoregressive lags make it into the final model. Because it is so old, some the more advanced features are better represented by ESM or AUTOREG. The ESM procedure is a moving average model. What’s great about ESM is its ability to throw deterministic trend and seasonality into the mix. You can customize just about every aspect of the model […]