...
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
*/
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.