*	NumObs(dataset, vname)
	places the number of observations in "dataset" into a macro variable named "vname".
	
	A test driver program is attached
;

%macro NumObs(dsn, vname);
	%global &vname;
	data _null_;
	if 0 then set &dsn nobs=count;
	call symput("&vname",compress(put(count,12.)));
	stop;
	run;
%mend;

/*options nocenter mprint;*/
/*data d;*/
/*	do i=1 to 10;*/
/*		output;*/
/*	end;*/
/*	run;*/
/*%NumObs(d,nd);*/
/*data _null_;*/
/*	put "number of observations=&nd";*/
/*	run;*/
