Mean Imputation in SAS Using the Hash Object

Mean Imputation in SAS Using the Hash Object

In the blog post Replace Missing Values With Mean in SAS, I demonstrate how to do mean imputation in SAS using Proc Stdize. This is the traditional way to do mean imputation in SAS. In this blog post, I will present an alternative using the SAS hash object. In the...
Binary Searching an Array in SAS

Binary Searching an Array in SAS

In the blog posts 8 Array Functions You Should Know and Search for Value in Numeric or Character Array, I introduce various functions to search an array. However, if an array is sorted, none of them exploit this information. In this post, I will demonstrate how to...
Another Word on Array Hashing in SAS

Another Word on Array Hashing in SAS

In the blog post An Array Hashing Scheme in SAS, we learn about hashing without the SAS hash object. Instead, we use temporary arrays to store keys and data. Furthermore, we use the Mod Function as a primitive hash function and design collision resolutions when two...
Another Word on Array Hashing in SAS

Array Hashing With Character Key Values

In the blog post An Array Hashing Scheme in SAS, I demonstrate a hashing technique in SAS using temporary arrays. The technique was developed in SAS by Paul Dorfman before SAS introduced the hash object. Evens so, under the right circumstances, the array hashing is...
How to Reverse Characters in a String in SAS

How to Reverse Characters in a String in SAS

A frequent question at the SAS Online Community is this. How do I reverse the characters in a string or sentence in SAS? Today, I will provide a few approaches to this problem. I will keep things simple and primarily use the Reverse Function and the Revers Character...
Count Distinct Values in SAS With the Hash Object

Count Distinct Values in SAS With the Hash Object

Count distinct values in SAS makes most programmers think of Proc SQL. However, there are other ways to count distinct values within groups in SAS. In this post, we investigate how to do so in the data step using the hash object. In the examples to come, we use the...