You will want to consult the documentation for "SAS Variable Lists".
http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#/documentation/cdl/e...
> 1. Count how many of the variables in a data set are
> numeric and how many are character
You can use PROC CONTENTS as suggested or the dictionary tables or in a data step as
[pre]
548 data _null_;
549 if 0 then set sashelp.shoes;
550 array _n
_numeric_;
551 array _c _char_;
552 n=dim(_n);
553 c=dim(_c);
554 putlog 'NOTE: ' n= c=;
555 stop;
556 run;
NOTE: n=4 c=3
[/pre]
> 2. Create a two different files; file 1 containing
> only numeric variables and file 2 containing only
> character variables.
>
> I know we can use the function vtype() to find out if
> a variable is char or numeric ..
>
> But, if you have thousand variables then how would
> you do it without having to know the name of that
> variable...
Again using a "SAS Variable List".
[pre]
580 data num(keep=_numeric_) chr(keep=_char_);
581 set sashelp.class;
582 run;
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.NUM has 19 observations and 3 variables.
NOTE: The data set WORK.CHR has 19 observations and 2 variables.
[/pre]