3

Suppose I have a table

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

and I want to make a table

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

using SAS proc sql. How can I do that?

synaptik
  • 8,971
  • 16
  • 71
  • 98

3 Answers3

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;
Longfish
  • 7,582
  • 13
  • 19
4

I know you asked for proc sql, but here's how you would do it with a data step. I think it's easier:

data table2(keep=c);
  set table1;
  c = a;
  output;
  c = b;
  output;
run;
Curly_Jefferson
  • 175
  • 1
  • 6
0
proc sql;
    create table combine as
    select name
    from one
    union
    select name
    from two;
quit;
ved_null_
  • 71
  • 2
  • 10