假設我有一個表SAS PROC SQL把2列到1列
A | B
===============
Dan | Jack
April | Lois
Matt | Davie
Andrew | Sally
,我想打一個表
C
======
Dan
April
Matt
Andrew
Jack
Lois
Davie
Sally
使用SAS proc sql
。我怎樣才能做到這一點?
假設我有一個表SAS PROC SQL把2列到1列
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;