Recoding values is one of the most common data prep tasks that folks need to do before they can analyze and report on data. In SAS, the most elegant way to handle this is by applying a SAS format. A SAS format allows you to "bucket" a bunch of raw data values into more managable categories. For example, a professor can map numerical test scores into letter grades ("A", "B", down to "F"), or even further into simply "pass" or "fail".
You can create a SAS format from scratch, writing a SAS program to include name-value mappings for recoding values, or ranges of values to map to a particular formatted label. But often you already have this information in a data set or spreadsheet, and it would be easier if you could just read in those values and make a SAS format from those recoding rules.
There is plenty of documentation and also conference papers to describe how to use the FORMAT procedure to get this done with SAS programming. The SAS Education team considers it an important topic and they regularly teach it in their beginning SAS courses. The trainers who cover SAS Enterprise Guide have been asking, on your behalf, for an easy way to do this without having to dive into SAS programming.
The SAS educators commissioned this task, and we've built it. It runs as an add-in to SAS Enterprise Guide 4.2.
The remainder of this post describes the details of the task, where you can download it, and how you can use it.
Where to download
The task is a custom task built for use in SAS Enterprise Guide 4.2. (It does not work in SAS Enterprise Guide 4.1 - sorry!) I've posted a version of this on the SAS support site, here. You can download the ZIP file and save it to your machine. The instructions for installing the task for use are in the README.txt file within the ZIP file.
For example, imagine you want to categorize US states into their broader regions, like so:
Or perhaps recode ranges of values into discrete labels, like this: