Hi DataYes,
You are getting this because your ID variable on your data set HAVE has length of 1. If you assign long enough length it will work. For example, the following data step will work fine:
data want;
length ID $3;
set have;
ID=ID_2;
drop ID_2;
run;
Or you can do it this way:
data want;
set have (drop=ID rename=(ID_2=ID));
run;
If you need a certain variable order on your data set you can achieve it with the retain statement placed before set statement:
data want;
retain Name ID address;
set have (drop=ID rename=(ID_2=ID));
run;
Hope this helps.
... View more