If your source data is not already standardized then also use the UPCASE option so that the informat is no more case sensitive.
proc format;
invalue sex_num (just upcase)
"MALE" =1
"FEMALE"=2
other=99
;
quit;
data sample;
sex="female";
sex2=input(sex,sex_num.);
run;
UPCASE
converts all raw data values to uppercase before they are compared to the possible ranges. If you use UPCASE, then make sure the values or ranges that you specify are in uppercase.
http://support.sas.com/documentation/cdl/en/proc/69850/HTML/default/viewer.htm#p1pmw90bl3jzgdn1w4202kclxtho.htm
... View more