假设我有一张桌子
A | B
===============
Dan | Jack
April | Lois
Matt | Davie
Andrew | Sally
我想做一张桌子
C
======
Dan
April
Matt
Andrew
Jack
Lois
Davie
Sally
使用 SAS proc sql
。我怎样才能做到这一点?
data have;
input A $ B $;
datalines;
Dan Jack
April Lois
Matt Davie
Andrew Sally
;
run;
proc sql;
create table want as
select A as name from have
union all
select B as name from have;
quit;
我知道您要求使用 proc sql,但以下是您将如何使用数据步骤进行操作。我认为这更容易:
data table2(keep=c);
set table1;
c = a;
output;
c = b;
output;
run;
proc sql;
create table combine as
select name
from one
union
select name
from two;
quit;