Hi all,
My dataset has assigned values 1-6 to a variable. I would like to recode the "6" to a "." because this value is throwing off my Proc Means statement for a scale that should be 1-5. Is there syntax to be able to do this? Is there a way to delete all of the "6" in the dataset?
Thank you.
Data step would be the basic tool.
Style choice involved whether to create a new variable or change actual value.
data new; set have; if variable=6 then variable= .R; run;
The .R is a "special missing". It will not be used in any calculation but you can check the value to tell that it is one that was Recoded (the special missing could be any .letter from .A to .Z or ._ ) to differentiate from any others that might be missing for a different reason.
Or this:
proc means data=yourdatasetname(where=(yourvariablename^=6));
and then the rest of your PROC MEANS statements.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.