...
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
*/
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.