Yes, you would need to sort it, sorry, I should have thought of that - its what happens if I can't test things. Put your rename on the datastep - also note how I use the code window which is the {i} above the post area, and format my code for readability - i.e. avoid using mixed case. A final point, it seems to me like the requirement changed somewhere, are you now saying that there is a variable in the data which holds the year value? If so then we can simplify it:
/* Step 1 - set all data together, and put year in as a data item */
data inter;
set hyptabs.src_utah_vitals: ; /* See here I use : to mean all datasets with that prefix */
run;
proc sort data=inter;
by apptdata;
run;
/* Transpose the data */
proc transpose data=inter out=want;
by year;
var value;
idlabel measure;
run;
data want;
set want (rename=(apptdate=visitdt ssn=ssn1 col1=htln ...));
run;