Tag: Programming

An easy way to find variables in common to data sets

Over the holidays I was having a discussion with my cat, Ms. Trixie Lou. A question that often arises during the first programming class is the following: how do I find the variables that are in common to these two or three data sets? As it turns out, …

Selecting the Second Duplicate Observation

  Dear Miss SAS Answers, I have read through a few Dear Miss SAS Answers blog posts, but I cannot seem to find what I am looking for. I need to extract only the second duplicate from a whole list of duplicates per account number. Is there a way to…

Jedi SAS Tricks: FUNC(y) Formats

In the previous episode, we built our own custom SAS function – a masterful trick indeed. Gordon Keener, a developer here at SAS, responded exuberantly “You think that’s cool? – try THIS!” and proceeded to demonstrate prodigious powers with the SAS by …

Jedi SAS Tricks – Roll Your Own Function

A SAS user (who lives in the the US) emailed me a question about SAS functions. He was read UTC (Coordinated Universal Time) datetime values from server logs, and to make future calculations and comparisons easier, he wanted to transform the value to …

Syntactic sugar – 6 SAS essentials

The 25 boys I teach on Sundays loved these cupcakes I baked for them for Easter… the sugared peeps had them completely satisfied. I love my tea or coffee laced with sugar. I think you‘d all agree that it is always more pleasant to meet a nice custo…

Jedi SAS Tricks: These aren’t the droids… Episode 1

How the power of the Force makes ridding yourself of problematic characters so much easier! I recently was invited to become an alternate instructor for Ron Cody’s SAS Business Knowledge Series class, “SAS Functions by Example”, and had the privilege…

Calculated values in PROC REPORT Compute Blocks

Dear Miss SAS Answers, In PROC REPORT can I use one calculated (computed) variable in the calculation of another computed variable? In the example below, I’m trying to use the value of the Bonus column to calculate the Total column:   compu…

Jedi SAS Tricks: Building a Name Suffix variable list

If you’ve taken one of my SAS classes you may recall “Mark’s 3 rules of programming”, the first of which is “Lazy programmers are GOOD programmers.”  One of the things I love about best about SAS programming is the plethora of functions an…