Now, I’m not as extreme as the person who created a SAS Tetris game, (Richard DeVenezia, in case you were wondering) but I still try to do just about everything in SAS, if only to prove that I can do it.
Why would someone who has been using SAS for 28 years decide to pick up Ruby? One legitimate reason is just for the hell of it, which is why I do most things. The other reason, though, is you will find that some things in Ruby are very easy that are not so easy in SAS, which makes it a very good complementary language.
For example, how many times have you had problems with a variable that was originally defined as a string somehow, even though that wasn’t what you intended at all. This often happens to me when importing Excel files where someone has typed spaces for missing data or before a number in a field I want to be read as numeric. However it happens, it’s annoying. You can use the input function in SAS to create numeric data from character data. You can create a new variable and add 0 to it and SAS will create a numeric variable. So, there’s ways to get around it. In Ruby, it’s really simple
varname.to_s — will change varname to a string variable
varname.to_i — changes varname to an integer
Then, there are some things that SAS just won’t allow you to do, like mix character and numeric variables in the same array. What if you WANT to do that? Well, Ruby is cool with it.
On the other hand, I haven’t found an easy way to get Ruby to do a logistic regression. So … I am thinking if I find the time to learn Ruby well enough, this may be a match made in heaven, read in and manipulate data easily, then send it out to a file to be analyzed by SAS.
Yes, there are other languages that would do this equally well, or perhaps better, but it’s pretty obvious that Ruby has much wider applicability than just data management. If I am going to go to a great deal of trouble to learn something in depth, it better be usable in a variety of situations. After all, I wouldn’t use SAS that much if it didn’t have a whole lot to offer besides Analysis of Variance.