...
I'm merging 2 datasets. ...<br />
Is there a simpler way to move a column in a data set?<br />
You can do OUTER UNION with CORRESPONDING in PROC SQL and not worry about manually re-ordering variables.
/* test data */
data one;
a=11; b=12; c=13; output;
run;
data two;
d=14; a=11; b=12; c=13; output;
d=24; c=23; b=22; a=21; output;
run;
proc sql;
select * from one
outer union corr
select * from two;
quit;
/* on lst
a b c d
11 12 13 .
11 12 13 14
21 22 23 24
*/
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.