Date: Thu, 8 Feb 1996 19:50:54 GMT
Reply-To: Dansys Consultants <dansys@ICAN.CA>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Dansys Consultants <dansys@ICAN.CA>
Organization: Internet Canada Corporation, Toronto, Canada
Subject: Re: Re[2]: Counting the # of variables in a SAS dataset
Mike Zraly <Mike_Zraly@ABTASSOC.COM> wrote:
> How about...
> %macro numvars (dsn);
> %local n;
> data _null_;
> set &dsn(obs=0);
> array arr[*] _all_;
This will only work when all the variables are the same type ie
numeric or character variables. But you can define two arrays, one for
each type, get two macro variables and then add them up.
by Bill He E-mail: billhe@ican.ca
> call symput('n', dim(arr));
> run;
> &dsn
> %mend;
|