Suppose you need to find out the number of rows and number of character and numeric variables in a data set.
In this program, correl is a data set.
data _null_;
if 0 then set correl nobs=n;
array nums _numeric_;
array chars _character_;
nvar = dim(nums);
cvar = dim(chars);
tvar= nvar + cvar;
call symput ('nrows',n);
call symput('numer',nvar);
call symput('chars',cvar);
call symput('totvar',tvar);
run;
%put &nrows;
%put &numer;
%put &chars;
%put &totvar;
In this program, correl is a data set.
Share Share Tweet