First of all, it seems that the specifications need to be clarified and put into writing before programming in SAS.
1) What are the rules for separating Res_Zip into rural zip and urban zip?
Identify by number of characters, by separator, by number, etc?
2) Clarify exclusion criteria.
Number of pieces, contents, data stored, etc?
3) What should be done with the excluded data?
Delete or keep, etc?
Once these are determined, you can proceed to the programming stage.
If you don't know the specific programming method such as functions, you can ask us again.
Don't forget to attach some data (sample or part of real data).
We don't know if you can program but just don't have your specifications together, or if you don't know everything and are at a loss in front of the data.