/* make sure location1.txt and location2.txt are in the root directory of your C: drive */ data one; infile 'c:\location1.txt'; input loc $ rep 5 trt 6-7 dog cat pig; data two; infile 'c:\location2.txt'; input loc $ rep 5 trt 6-7 dog cat pig; data one; set one; proc sort; by loc rep trt; data two; set two; proc sort; by loc rep trt; data three; merge one two; by loc rep trt; proc print; run;