...
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
*/
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.