Hi Ronein,
As indicated by others, it is not entirely clear what you want, even though you have specified a want data set, but I think you're telling us that there is a problem with that data set.
You have specified nr_laks: in your retain statement twice, I expect you only meant this to appear once, but even so, as no such variables starting nr_laks appear in your data steps then what do you expect to be retained?
Are you just trying to rearrange existing columns? If yes, then is what you want demonstrated by the below want2 data set (makes sex the last column)? The have data set is setting up the measure: variables. The want data set is, I believe what you might have been trying. If the below is not what you want then provide a want data set that demonstrates what output you do want, please.
data have;
set sashelp.class(rename = (age = measure1 weight = measure2 height = measure3));
run;
data want;
retain name measure:;
set have;
run;
data want2;
set have(keep = name measure:);
set have(keep = sex);
run;
Thanks & kind regards,
Amir.
Edit: corrected variable name.
... View more