Hello, Hope this below snippet works for you. proc sql; create table final as select a.*, b.zip as Zip2 from customer a left join sashelp.zipcode b on a.ZIP = b.ZIP ; quit; Assuming the CUSTOMER table as a dataset which contains the invalid zip codes. If we left join the sashelp.zipcode to our CUSTOMER table and selecting the ZIP (as ZIP2) from sashelp.zipcode would leave the invalid ZIP with missing values (Since it SAS cannot find the matching value) data final( drop=zip rename=(zip2=zip) ); set final ; run; In the above snippet we will drop the ZIP field with invalid codes and Rename the ZIP2 to ZIP(which obviously have the Invalid zip codes as '.') Note: the above code is written based on the assumption that the Zip code is 5 digit.
... View more