I am trying to figure out how to change character value labels to numeric values.
For example:
"ABCDEF"=1
"GHIJKL"=2
MNOPQR=3
STUVWX=4
"YZ"=5
I know how to do it in the reverse (numeric to character) using proc format. I attempted to use the same method but maybe I am just using the incorrect syntax??? Suggestions please
Like this?
proc format;
invalue read
"ABCDEF"=1
"GHIJKL"=2
'MNOPQR'=3
'STUVWX'=4
"YZ" =5 ;
data T;
NUM=input('YZ',read.);
run;
NUM=5
You may want to post code and log so that we can help to improve / fix what you already have.
CFC_SAS_Communities_400x225.jpg
It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.
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.