I just saw data_null_ beat me to it. Anyway . . .
This is an example of how I would do it, but it takes a couple steps. In this example, I create three datasets with different variable formats. After merging these sets, I determine the numeric variables using PROC CONTENTS and PROC SQL and then limit my final dataset to just those variables.
[pre]data a (keep=VarA:) b (keep=VarB:) c (keep=VarC:);
VarA1 = 8; VarA2 = 'Yes'; output a;
VarB1 = 'True'; VarB2 = 256; output b;
VarC1 = 'Positive'; VarC2 = 'Nebraska'; VarC3 = 87.9; output c;
run;
data x;
merge a b c;
run;
proc contents data=x out=contents (keep=name type) noprint;
run;
proc sql noprint;
select name into :varlst separated by ' ' from contents where type = 1;
quit;
data x;
set x;
keep &varlst;
run;
[/pre]
Message was edited by: 1162