Easwara Moorthy wrote:
> Hi all,
> %let rc=%sysfunc(where(&dsid,'a=1'));
> I'm gettin error that 'ERROR: The WHERE function referenced in the
> %SYSFUNC or %QSYSFUNC macro function is not found.'
> is there any other way to get a solution??
The WHERE() function is an SCL-only function. It is not available to Data
Step (and thus not available to macro).
Take the time to write sensible macros with local variables, its worth the
effort. %get doesn't cut it as sensible.
You can place your where criteria as a where= data set option in the dataset
parameter of the OPEN() function.
%macro NLOBSF (data=);
%local dsid nlobsf rc;
%let dsid = %sysfunc(open(&data));
%if &dsid %then %do;
%let nobs =%sysfunc(attrn(&dsid,NLOBSF));
%let rc = %sysfunc(close(&dsid));
More generalized might be
%macro attrn (data=, attr=);
%let attrn_return = %sysfunc(attrn(&dsid,&attr));
%put %ATTRN (data=..., attr=NLOBSF);
An even more general form for encapsulating attrn/c is plausible.
Take a look at Rolands macros, he has done tons of this already.
(http://www.datasavantconsulting.com/roland/ sasauto extensions)
I think another utility minded macro author goes by a moniker something like
And all the other guys-n-gals too numerous to mention...
Richard A. DeVenezia