LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 1996, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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;


Back to: Top of message | Previous page | Main SAS-L page