{"id":1166,"date":"2011-05-25T10:32:27","date_gmt":"2011-05-25T15:32:27","guid":{"rendered":"http:\/\/www.thejuliagroup.com\/blog\/?p=1166"},"modified":"2011-05-25T10:32:27","modified_gmt":"2011-05-25T15:32:27","slug":"annoyances-with-sas-that-dont-exist-in-ruby","status":"publish","type":"post","link":"https:\/\/www.thejuliagroup.com\/blog\/annoyances-with-sas-that-dont-exist-in-ruby\/","title":{"rendered":"Annoyances with SAS that Don&#8217;t Exist in Ruby"},"content":{"rendered":"<p>Now, I&#8217;m not as <a href=\"http:\/\/www.devenezia.com\/downloads\/sas\/af\/?topic=27\">extreme as the person who created a SAS Tetris game<\/a>, (Richard DeVenezia, in case you were wondering) but I still try to do just about everything in SAS,\u00a0 if only to prove that I can do it.<\/p>\n<p>Why would someone who has been using SAS for 28 years decide to pick up Ruby?\u00a0 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.<\/p>\n<p>For example, how many times have you had problems with a variable that was originally defined as a string somehow, even though that wasn&#8217;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&#8217;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&#8217;s ways to get around it. In Ruby, it&#8217;s really simple<\/p>\n<p>varname.to_s\u00a0\u00a0\u00a0\u00a0 &#8212;\u00a0 will change varname to a string variable<\/p>\n<p>varname.to_i\u00a0 &#8212; changes varname to an integer<\/p>\n<p>Then, there are some things that SAS just won&#8217;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.<\/p>\n<p>On the other hand, I haven&#8217;t found an easy way to get Ruby to do a logistic regression. So &#8230; 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.<\/p>\n<p>Yes, there are other languages that would do this equally well, or perhaps better, but it&#8217;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&#8217;t use SAS that much if it didn&#8217;t have a whole lot to offer besides Analysis of Variance.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now, I&#8217;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,\u00a0 if only to prove that I can do it. Why would someone who has been using SAS for 28 years decide to pick&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9],"tags":[],"class_list":["post-1166","post","type-post","status-publish","format-standard","hentry","category-software"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/1166","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/comments?post=1166"}],"version-history":[{"count":2,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/1166\/revisions"}],"predecessor-version":[{"id":1389,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/posts\/1166\/revisions\/1389"}],"wp:attachment":[{"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/media?parent=1166"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/categories?post=1166"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thejuliagroup.com\/blog\/wp-json\/wp\/v2\/tags?post=1166"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}