I am trying to combine 5 different data sets, and on the 5th one, it is saying I have an error that my BY variables are not sorted properly, even though I included PROC SORTS in the same way for each data set:
PROC SORT DATA = HypImpt.UTAH_VITALS_2010 OUT= UTAH_VITALS_2010;
BY SSN ApptDate;
RUN;
PROC SORT DATA = HypImpt.UTAH_VITALS_2011 OUT= UTAH_VITALS_2011;
BY SSN ApptDate;
RUN;
PROC SORT DATA = HypImpt.UTAH_VITALS_2012 OUT= UTAH_VITALS_2012;
BY SSN ApptDate;
RUN;
PROC SORT DATA = HypImpt.UTAH_VITALS_2013 OUT= UTAH_VITALS_2013;
BY SSN ApptDate;
RUN;
PROC SORT DATA = HypImpt.UTAH_VITALS_2014 OUT= UTAH_VITALS_2014;
BY SSN ApptDate;
RUN;
DATA WORK.Vitals_UT;
SET HypImpt.UTAH_VITALS_2010
HypImpt.UTAH_VITALS_2011
HypImpt.UTAH_VITALS_2012
HypImpt.UTAH_VITALS_2013
HypImpt.UTAH_VITALS_2014;
BY SSN ApptDate;
RUN;
The error it gives me is
ERROR: BY variables are not properly sorted on data set HYPIMPT.UTAH_VITALS_2014.
Any suggestions?