Hello all, I need some help in cleaning up an external dataset if possible, I would greatly appreciate it! I imported an external excel dataset into SAS. The variable age is in intervals of age groups (20-29, 30-39, etc.) I am supposed to format the age into age groups and clean the dataset to make it look nice. The issue I am running into is that the dataset has a bunch of messy values like (20ag-29, 30-39exa, Under 18, 70 and above, and missing values). First I used a compress function to rid of any letters or symbols in the dataset, but then I got stuck. I normally use a Proc Format to create my age variables and so far have: Proc Format Library=WorkData; Value Ageft. 18-29 = "18-29" etc. all the way to 60-69. However, how do I take into account the values that say "Under 18" "70 and above" as well as the blank cells? Would I need to use an array for the blank cells and code them as missing? Thank you in advanced! (Note: When I run a Proc Freq, it takes into account everything except the "Under 18" values. I used 70-99 = "70 and above" and I think that read fine.")
... View more