Date: Wed, 9 Jun 2004 15:46:49 +0200
Reply-To: "Groeneveld, Jim" <jim.groeneveld@VITATRON.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Groeneveld, Jim" <jim.groeneveld@VITATRON.COM>
Subject: Re: Retreiving record Counts through Macro ATTRN
Content-Type: text/plain; charset="iso-8859-1"
Hi Easwar,
WHERE is not a function and thus can not be used that way.
Regards - Jim.
--
. . . . . . . . . . . . . . . .
Jim Groeneveld, MSc.
Biostatistician
Science Team
Vitatron B.V.
Meander 1051
6825 MJ Arnhem
Tel: +31/0 26 376 7365
Fax: +31/0 26 376 7305
Jim.Groeneveld@Vitatron.com
www.vitatron.com
My computer didn't see Venus better than I did, but I didn't see it in reality.
[common disclaimer]
-----Original Message-----
From: Easwara Moorthy [mailto:easwar_ps@YAHOO.COM]
Sent: Wednesday, June 09, 2004 13:00
To: SAS-L@LISTSERV.UGA.EDU
Subject: Retreiving record Counts through Macro ATTRN
Hi all,
I've a specific requirement which follows:
data one;/*sample dataset i created for testing*/
a=1;output;a=1;output;a=1;output;a=2;output;a=1;output;a=2;output;
run;
I want the record count of a=1 as another variable in another dataset.
%macro get;
%let dsid = %sysfunc(open(one));
%if &dsid %then %do;
%let rc=%sysfunc(where(&dsid,'a=1'));
%let nobs =%sysfunc(attrn(&dsid,NLOBSF));
%let rc = %sysfunc(close(&dsid));
&nobs
%end;
%mend;
data two;
anothervariable=%get;
run;
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??
Thanks in advance,
Easwar.