Why even bother formatting a meaningful value like an area code to a non-meaningful number like 1 or 2 or 3? This is not necessary and not helpful to your coding or to the usage of the results.
How about this:
data two;
set one;
if phonenumber not in (123 456 789) then areacode=.;
run;
Now, the area codes remain understandable, rather than the meaningless 1 or 2 or 3. You can even assign a format to change the missing to "Out of State".
Which brings me to a question ... do you really want to do this logic on variable PHONENUMBER or should you be doing this logic on variable AREACODE? Have you mixed up the variable names? Seems to me you've got the wrong variable, you want to do this on AREACODE and not PHONENUMBER ... or at least you have the wrong variable name given the values it contains.
... View more