**this block of code reads in two data files that have the same ID variables but different other variables:
data set ONE has playerID yearID Y.  File TWO has playerID yearID and X.
The data need to be sorted by the two ID variables before merging them into a third data set. This third
data set will have 4 columns" playerID yearID y x;

data one;
infile path to file;
input playerID yearID y ;

run;
proc sort data=one;
by playerID yearID;
run;

 

data two;
infile path to file;
input playerID yearID x ;
run;

proc sort data=two;
by playerID yearID;
run;

 

data three;
merge one two;
by playerID yearID;
run;

proc print;
run;