Hello,

I am trying to screen out survey responses that are out-of-state using zip code. My plan was to make an indicator variable:

gen out_state_zip=1 if !inlist(zipcode, zip1, zip2,....ziplast)

Since there are so many zip codes (nearly a thousand) I got an error message stating "expression too long." Is there another method I could use to flag out of state zip codes?

My backup option will be to create a separate data set with Michigan zip codes, then do a many to 1 merge with my survey data set, and exclude surveys that don't have a zip code match.

Many thanks,
Alyssa