I would start with something like this. Keep in mind that there's only one way to get all the observations and also be unique at the zip+naics level and that is if your first two tables only have one observation per zip+naics level and your second two tables only have one observatikon per zip level.
[pre]
proc sql;
create table all as
select *
from year05d a, year06d b, year05t c, year06t d, look-up table e
where a.zip = b.zip
and a.naics = b.naics
and c.zip = d.zip
and c.zip = a.zip
and a.naics = e.naics;
quit;
[/pre]
Message was edited by: 1162