Hello 🙂
Hoping I can get some help here. I have a variable that has postal codes listed for case ID's. Some are available and some are not. I am trying to re-code my 'Postal Code' variable so that it either has 0 for missing and 1 for available, or I can also change it to "Available" and "Not Available" ...I managed to change the missings to 0 but I can't figure out how to change the many diff postal codes into a single number or word. Any help would be really appreciated!
If you have recoded 'Missing' as 0 you should be able to recode the 'Non-missing' values to 1 eg., with simply IF/THEN, ELSE statement:
data want;
set have;
if not missing(PostalCode) then PostalCode=1;
else PostalCode=0;
run;
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.