如何用proc sql 来去第一个table里所有的columns但是第二个table只是取两个columns,而且需要两个table进行union。注意第一个table有150多个columns所以不能手写select。data step的做法就是
data ****;
set 111;
set 222(keep=*** ****)key=****/unique;
if _IORC_ NE 0 then do;
...........
NOTE: The data set WORK.A has 2 observations and 2 variables.
NOTE: DATA statement used (Total process time):
real time 1.68 seconds
cpu time 0.12 seconds
5 data b;
6 x=1;m=1; n=1;output;
7 x=2;m=2;n=2;output;
8
NOTE: The data set WORK.B has 2 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
9 proc sql;
10 create table c as
11 select a.* ,b.m,b.n
12 from a ,b
13 where a.x=b.x ;
NOTE: Table WORK.C created, with 2 rows and 4 columns.
14 quit;
NOTE: PROCEDURE SQL used (Total process time):
real time 1.82 seconds
cpu time 0.09 seconds