Tag: sas programming

Pitfalls of the LAG function

In the immortal words of Britney Spears: Oops! I did it again. At least, I’m afraid that I did. I think I might have helped a SAS student with a homework assignment, or perhaps provided an answer in preparation for a SAS certification exam. Or maybe it was a legitimate […]

A SAS options viewer for SAS Enterprise Guide

On the heels of the release of the popular SAS macro variable viewer from last month, I’m providing another custom task that I hope will prove just as useful. This one is a SAS options viewer, similar in concept to the OPTIONS window in SAS display manager. You can download […]

Inspecting SAS macro variables in SAS Enterprise Guide

The SAS macro variable “inspector” is a custom task that plugs into SAS Enterprise Guide 4.3. You can use it to view the current values for all SAS macro variables that are defined within your SAS session. You can also evaluate “immediate” macro expressions in a convenient quick view window. […]

Take SAS program editor abbreviations to the next level

Rick posted a tip today about using abbreviations in the SAS program editor window (often referred to as the “enhanced editor”). Defining abbreviations is a great way to save keystrokes and re-use “templates” of code that you’ve squirreled away. (One of Rick’s readers also picked up on the tip, and […]

Do you mind if we dance with your DATEs (or DATETIMEs)?

I’ve been working with date-time data on a recent project, and I’ve come across a few SAS programs that have “opportunity for improvement” when it comes time to create reports. (Or maybe I haven’t, and I contrived this entire blog post so that I could reference one of my favorite […]

Next time, do your own homework

SAS programming is taught in schools all over the world, including in high schools.  Occasionally, I receive questions via my blog such as this one: Can somebody help me on this? Write a short DATA _NULL_ step to determine the largest integer you can store on your computer in 3, […]

How to add HTMLBlue to your list of styles in SAS Enterprise Guide

One of the great innovations with SAS 9.3 is the focus on ODS statistical graphics. “Wait a minute,” you’re thinking, “weren’t ODS graphics added in SAS 9.2?” Yes, that’s true.  But with SAS 9.3 there is even more capability: more analytical SAS proce…

Computing age in SAS 9.3

It seems like such a simple problem: how can you reliably compute the age of someone or something? Susan lamented the subtle issues using the YRDIF function exactly 1.0356164384 years ago. Sure, you could write your own function for calculating such th…