tag:blogger.com,1999:blog-106293752024-03-19T00:22:45.410-07:00Data StepsA regularly updated blog about programming with the SAS System.Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.comBlogger108125tag:blogger.com,1999:blog-10629375.post-52572613669285858362012-09-11T12:37:00.000-07:002012-09-11T12:37:31.902-07:00WUSS 2012 Long Beach PaperI have posted my paper (An Introduction to Git Version Control...) at my sas-resources.com site:
http://www.sas-resources.com/recipes/an-introduction-to-git-version-control-for-sas-programmers
Thanks to everyone at WUSS who attended, everyone who asked questions and everyone who has given feedback! -sStephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com6tag:blogger.com,1999:blog-10629375.post-35099848860792084602012-08-01T14:55:00.000-07:002012-08-01T14:55:49.501-07:00I Git BusyWhile I was on vacation, I got a friendly email reminding me that my WUSS 2012 paper was due July 30th. Yikes! I had exactly one week to get home and write it. My mother calls it procrastinating. I prefer to think of it as Lazy Loading.
So I was a bit busy last week.
But I finished it. And I think it's good. At least, I hope it's good.
It is an Introduction Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com337tag:blogger.com,1999:blog-10629375.post-11287351067531497222012-06-12T21:09:00.000-07:002012-06-12T21:09:21.174-07:00Rainbow Table SaltDISCLAIMER: I am not an expert at cryptology. But I generally understand the industry best practices and have implemented this stuff on several sites. That said, read on at your own risk :)
There's been a lot of talk about LinkedIN passwords getting stolen. It's an interesting read and it made me think it would make for a good blog post.
If you read Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com27tag:blogger.com,1999:blog-10629375.post-21006992501986294942012-06-06T15:51:00.000-07:002012-06-11T09:23:22.681-07:00Comparing Macro ValuesI was working on some SAS macro code today that I hadn't touched in quite a while. Actually, I haven't even been working on much SAS code for a while. So it was nice to get my mind back to the language I am most familiar with.
I spent a good thirty minutes staring at a problem that was so simple that it should not have taken me long to figure it out.
A funny thing happens when you spend your Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com4tag:blogger.com,1999:blog-10629375.post-11910816145162860092012-04-12T12:50:00.003-07:002012-04-12T13:07:28.718-07:00What's The Idea?The easy part is done: code got written, various technical barriers were overcome, a prototype was built, and the proof-of-concept was proven.Now the hard part: figuring out if the concept is even a good idea or not. Of course, _I_ think it's a good idea, but that doesn't always translate into the real world :)So what's the idea? I want to solve a problem that I run into at large conferences. Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com6tag:blogger.com,1999:blog-10629375.post-71663481051748597532012-04-04T11:54:00.003-07:002012-04-04T12:45:07.058-07:00Conference/SmartphoneJust a quick two-part question:Do you plan on attending a SAS conference this year (local, regional, global, any)?Do you use a smartphone?Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com1tag:blogger.com,1999:blog-10629375.post-54680584174726480572012-03-27T10:42:00.003-07:002012-03-27T10:54:51.420-07:00Version ControlTwo things that make me nuts when I work with SAS:no here documentsno string interpolationOk, now that I got that out of the way. I am thinking of putting together a talk on version control for SAS programmers. Do you currently use version control for your SAS programs? Yes, no, which one, why?I use git for nearly everything. Not sure how I ever got by without it.Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com9tag:blogger.com,1999:blog-10629375.post-36128440318937011102012-03-13T13:23:00.006-07:002012-03-13T15:50:03.179-07:00Resume MotivationThe other day I blogged about my new SAS-Resources site and some of my motivations for creating it. But I left one motivation out of that introductory post. Not because it is less important, actually it's one of the most important. So important that I wanted to talk about it in its very own post. So what motivation is that? Resumes. Specifically, resumes are broken.They don't work. They Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com2tag:blogger.com,1999:blog-10629375.post-57390226658974231112012-03-08T09:08:00.003-08:002012-03-08T14:19:44.312-08:00SAS-Resources SiteMan it has been a long time since I updated this blog! But I have a good excuse. I have been working on a new site to share SAS stuff.There are already sites for programmers to share information, why would you create another one? Good question!Pretty much the top three online resources are: sasCommunity.org, SAS-L, and support.sas.com forums.SAS-L is an awesome way to get questions answered Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com4tag:blogger.com,1999:blog-10629375.post-90553214773634570542011-12-20T15:23:00.000-08:002011-12-20T15:50:57.405-08:00Fat FingersI just looked at some code I had written a few months ago. It categorized things based on a bunch of criteria. At the end of the data step I output the categories that did not fit into a definition bucket nicely:if bucket in(12,11,10,7,6,5,4) then output junk;But then I remembered that I also wanted to see if any of them went past all the logic and came up with a missing bucket:if bucket in(Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com2tag:blogger.com,1999:blog-10629375.post-155200830787036952011-12-06T15:43:00.000-08:002011-12-06T15:51:37.704-08:00SAS 9.3Why is SAS 9.3 so big? Wait, not big. Massive. Huge.Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com0tag:blogger.com,1999:blog-10629375.post-3750923864139548702011-12-01T15:04:00.001-08:002011-12-01T15:20:02.793-08:00Little Utility MacroA lot of times when I am working with interactive SAS, I find myself staring at a SAS date that has not been formatted. The quickest way to see the actual date was to go to my "scratch" enhanced editor and write a quick data _null_ to put it to the log. That was before I realized that macros can be invoked from the command line.%macro date(d); %let r = %sysfunc( putN(&d,mmddyy10.) ); %put &r;%Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com0tag:blogger.com,1999:blog-10629375.post-61068498732420042672011-11-16T16:12:00.000-08:002011-11-16T16:15:19.057-08:00Remove Formatting From VariablesWhat do you do if you have a SAS data set with formatted variables, but you don't have access to the format? You have to remove the format from the variables if you want to work with the data set.The easiest way to remove formats from variables in a data set is to use proc datasets.Assuming I have a data set named Responses with some variables that have formats applied to them that no longer Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com3tag:blogger.com,1999:blog-10629375.post-40630855694810062342011-11-09T13:36:00.000-08:002011-11-09T13:59:09.693-08:00I have been following some of the recent talk going on the blogosphere about R and SAS.R vs SAS/SPSS in Corporations: A view from the other sideShe is correct that it is nearly impossible to get large organizations to give up their propietary software. And she does a great job explaining why. So should the SAS Institute be worried about R?First lets take a moment to point out something that is Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com1tag:blogger.com,1999:blog-10629375.post-50428318879012438692011-11-02T11:38:00.000-07:002011-11-02T11:44:19.864-07:00SAS Research Programmer/AnalystSAS Research Programmer/Analyst job in Worcester MassachusettsLocation: Worcester Telecommute: NoJob Type: full time Pay: 50,000-60,000 Research Analysts/Programmers provide meaningful contributions by creating, managing, and analyzing large and complex data files on health care utilization. The Institute’s faculty conducts local and multi-site research studies on important public health Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com0tag:blogger.com,1999:blog-10629375.post-28441407650926838482011-11-01T14:50:00.000-07:002011-11-01T15:26:49.703-07:00New SAS Job SiteWell, I finally got my new site up and running. It is a job site specifically for SAS programmers looking for SAS jobs in the US. I switched the www.sasCoders.com URL from this blog to the new site yesterday. Hopefully it won't be too confusing to people while Google updates their index. This blog can always be reached at http://datasteps.blogspot.com If you are a recruiter, please hop on over toStephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com1tag:blogger.com,1999:blog-10629375.post-34387375459603265792011-10-12T12:37:00.000-07:002011-10-12T13:00:28.267-07:00Efficiently Drop/Keep SAS Data Set ColumnsWhat is the most efficient way to drop/keep columns (variables) in sas tables (data sets)?For the most part, we would correctly say "using a keep= option on the data set as it is being read into the current step." A quick example to illustrate: data someData; set myData(keep= x y z); run; proc sort data = myData(keep= x y z) out= someData; by x y; run;In fact, I even wrote a whole paperStephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com2tag:blogger.com,1999:blog-10629375.post-59602375826350600352011-10-06T11:07:00.000-07:002011-10-06T11:27:32.555-07:00Thank You Steve JobsToday I am going to dedicate my little slice of this giant internet to Steve Jobs. Like a lot of people around the world, I found out Steve Jobs passed away through an Apple product. His vision and creativity touched all of us. Rather than me clumsily listing all the inspiring things he accomplished with his short time, I thought it would be better to share some of his own words. If you Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com1tag:blogger.com,1999:blog-10629375.post-61828831280216163632011-08-09T12:22:00.000-07:002011-08-09T12:26:47.089-07:00First One In Gets the WinYikes, it's been a while since the last update! So I will try to keep this one short and useful. Most everybody knows there are essentially two ways for tables to be merged in SAS: using the merge statement in the data step and using a join in SQL. Programmers tend to prefer one way over the other, and generally they are interchangeable. However, there are some minor differences that you Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com0tag:blogger.com,1999:blog-10629375.post-43734465417242666322011-03-29T14:05:00.000-07:002011-03-29T14:14:47.152-07:00Data Step HooksHere is something to keep in mind when using the END= option on the set statement: There is no guarantee you will hit the end of file.Simple example to illustrate:data test; do i = 1 to 10; output; end;run;data _null_; set test(where=(i > 10)) end= eof; if eof then put "It set EOF for end of file";run;In the SAS documentation this is stated cryptically:Restriction: END= cannot be used Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com2tag:blogger.com,1999:blog-10629375.post-22532990906615780742010-11-15T15:06:00.000-08:002010-11-15T15:32:10.864-08:00!= does not == neIn general, the more programming languages you work with, the better you are going to become as a programmer. I try to work with a new language about every year, so I can stretch my little brain in lots of different directions.However, the downside is sometimes you lose track of the syntax that used to be second nature to you. Or maybe it's just old age? Wait, what was I talking about?Oh yeah,Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com5tag:blogger.com,1999:blog-10629375.post-17277468686017307632010-09-16T08:36:00.000-07:002010-09-16T08:40:42.295-07:00Leading ZeroesHere's a situation that comes up pretty often. You receive a file that contains zip codes. It's an excel file and you need to create a SAS data set out of it, so you can do some nifty market analysis. No problem, you clickety clickety through the SAS import wizard and voila! a data set is created. However, the zip_code variable is numeric and doesn't have leading zeroes.Even though zip codes Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com3tag:blogger.com,1999:blog-10629375.post-46469187024884517062010-08-31T15:05:00.000-07:002010-08-31T15:26:42.175-07:00It's a Math, Math WorldHere is a blog that I found. It belongs to Michael O'Brien. I have not had a chance to really read through any of his posts, but it is on my to-do list as soon as I have a little tiny bit of time. Based on my quick cursory view of it, he seems to be writing quite a bit about statistics. And not the crazy insane look how whippety smart I am statistics writing that makes my eyes hurt and my Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com1tag:blogger.com,1999:blog-10629375.post-19593007372520853452010-07-26T11:27:00.000-07:002010-07-26T11:36:54.248-07:00Thanks LabSug!Thank you Los Angeles Basin SAS User Group for listening to my talk on SAS MACRO: Beyond The Basics.The room provided by RAND was excellent. Everything was well organized and the day went without a hitch. The audience was very engaged and had great questions (definitely not the sleepy group I was expecting right after lunch!). Overall I had a great time, and look forward to getting the chance Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com1tag:blogger.com,1999:blog-10629375.post-15108368127196036072010-07-19T15:25:00.000-07:002010-07-19T16:00:17.384-07:00I have a data set of sales data by day. Unfortunately the names of the columns represent the dates. In order to work with the data, I need to transform the data set so each day represents an observation.The data set looks something like this:store _010_05_01 _010_05_02 _010_05_03 ....1 8 5 62 6 9 33 7 9 8....As you can see, I Stephenhttp://www.blogger.com/profile/01356803756509162192noreply@blogger.com1