3

假设我有一张桌子

 A     |  B
===============
Dan    | Jack
April  | Lois
Matt   | Davie
Andrew | Sally

我想做一张桌子

 C     
======
Dan  
April 
Matt   
Andrew 
Jack
Lois
Davie
Sally

使用 SAS proc sql。我怎样才能做到这一点?

4

3 回答 3

4
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;
于 2013-05-22T08:07:11.910 回答
4

我知道您要求使用 proc sql,但以下是您将如何使用数据步骤进行操作。我认为这更容易:

data table2(keep=c);
  set table1;
  c = a;
  output;
  c = b;
  output;
run;
于 2013-05-22T13:31:46.953 回答
0
proc sql;
    create table combine as
    select name
    from one
    union
    select name
    from two;
quit;
于 2013-07-27T09:18:51.210 回答