The SAS hash object has many different applications. Todays topic is no exception. Suppose we want to display all variables in the Program Data Vector (PDV) in a SAS data set. This is not a trivial task. Especially not if we want to do so dynamically. However, the...
In previous articles, I write about random sampling in SAS with and without replacement. The approaches we present are pretty basic and out-the-box SAS procedures such as Proc Surveyselect. Also, we use the data step in a few different ways. However, all the...
Regularly, a user asks a question on the SAS Community regarding grouping of values from some fuzzy logic. Usually, this logic is not straight forward and the logic varies from question to question. However, the question almost always have one thing in common. The...
In a recent thread at the SAS Community a user asked how to generate all possible sums of a list of numbers in SAS. This is not a trivial subject. Also, one should be careful that the list of number is not too big. Binary logic tells us that when N = 20, the number of...
In the blog post 3 Ways to Select Top N By Group in SAS, we learn a few ways to create top 10 lists by group in SAS. One of the approaches uses a hash object and creates the result in a single pass of the data. However, two requirements must be present for this to...
In the blog post Binary Searching an Array in SAS, we explore how to perform a binary search of a temporary array in SAS. We compare different approaches and learn that the binary search is much faster than a simple sequential search. Today, let us use the binary...