...
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
*/
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.