|
How about this:
data big;
retain x1-x10 (1 2 3 4 5 6 7 8 9 10);
data small;
retain x1-x5 (2 3 4 5 6);
*find the variable names from small *;
proc sql noprint;
select name into :namelist separated by ' '
from dictionary.columns
where libname='WORK' and memname='SMALL'
;
data big;
set big (keep=&namelist);
proc print;
run;
-------------
Obs x1 x2 x3 x4 x5
1 1 2 3 4 5
HTH
Ya Huang
-----Original Message-----
From: Chelsea [mailto:admin.ra@IOIP.COM]
Sent: Sunday, February 18, 2001 7:04 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: keeping variable
I have a smaller dataset with 600 variables, and a bigger dataset with 1200
varialbes. Now I need to create a subset from the bigger dataset, but the
subset should only have 600 variables that are present in the smaller
dataset. How should I do this?
Thanks!
- chelsea
[text/html]
|