Recoding is possible in many ways in SAS. Mostly two of them are used :
1) Hard coding. That means you create a dataset with a Data step, in which you compute a new variable, using some kind of IF/THEN/ELSE (or, preferrably, SELECT/WHEN/OTHERWISE) statements to assign values to your new variable.
E.g.
[pre]
DATA myNewDataset ;
SET myOldDataset ;
SELECT ;
WHEN (myVar < 10) myNewVar = "< 10" ;
WHEN (myVar < 50) myNewVar = "[10;50[" ;
OTHERWISE myNewVar = ">= 50" ;
END ;
RUN ;
[/pre]
The SELECT/WHEN statements are processed in this order, and once a WHEN condition is true, the action is executed and the program "jumps" to the END statement. If no WHEN condition is true, then the OTHERWISE action is executed.
2) "Soft" coding : just create a format. This is the PROC FORMAT job. For the same example, code would be... [pre]
PROC FORMAT ;
VALUE recode
LOW -< 10 = "< 10"
10 -< 50 =[10;50["
50 - HIGH = ">= 50"
;
RUN ;
[/pre]
Then, in the following procedures, you just have to add a Format statement to associate your existing variable with its newly-created format. E.g.
[pre]
PROC whatever DATA = myOldDataset ;
FORMAT myVar recode. ;
...
RUN ;
[/pre]
Don't forget the POINT after the format name when you use it (but there is no point when you CREATE it ; sounds weird, but that's how it goes).
I prefer soft coding over hard coding, the latter being a lot more flexible, and taking a lot less space & time to process. In Enterprise Guide, you find a task to design formats (and then assign them to variables by changing their properties, selecting FORMAT and looking in the USER-DEFINED FORMATS category). You also find a recoding screen in the query window.
For a lot more explanations on formats and Data step, I suggest you buy The Little SAS Book, which is a summary of all the important things you might have to know to code in SAS.
Regards,
Olivier