Date: Mon, 11 Mar 2002 12:59:57 -0500
Reply-To: "Dorfman, Paul" <Paul.Dorfman@BCBSFL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Dorfman, Paul" <Paul.Dorfman@BCBSFL.COM>
Subject: Re: ERROR: Required operator not found in expression
Content-Type: text/plain; charset=iso-8859-1
Doug,
You are trying to make a Data step function NMISS() return a macro value in
a macro conditional sentence, where it could be tested. To the macro
processor, NMISS is just text, for it does not begin with a macro trigger.
However, this:
%sysfunc(nmiss(&nme_lstcsv))
is a directive to execute NMISS(), convert the result to a character string,
and move it to the macro memory, where it can be tested implicitly using the
%eval() macro function. In a macro expression, you should always use
%sysfunc() if you need a Data step function to return a value. %sysfunc()
functions (but not their arguments!) can be nested. RTFM on it.
Kind regards,
=======================
Paul M. Dorfman
Jacksonville, FL
=======================
> -----Original Message-----
> From: Cacialli, Doug [mailto:Doug_Cacialli@URMC.ROCHESTER.EDU]
> Sent: Monday, March 11, 2002 12:20 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: ERROR: Required operator not found in expression
>
>
> Y'all,
>
> Let me start off by saying that I've been using SAS less than
> six months and
> I am really just starting to use macros in a meaningful way.
> I was hoping
> someone could elaborate on this error message SAS keeps
> kicking back to me.
> I've included the macro below.
>
> 592 %macro dolooping;
> 593 %if nmiss(&nme_lstcsv)>0 %then %do;
> 594 data affdx;
> 595 update affdx test_merge;
> 596 by id;
> 597 n_var = n(&nme_lstcsv) + 1;
> 598 array date_cng (*) &nme_lstspc;
> 599 do i=1 to hbound(date_cng) until (i = n_var);
> 600 if date_cng(i) = . then date_cng(i) = datea;
> 601 end;
> 602 drop datea;
> 603 %end;
> 604
> 605 %else %if nmiss(&nme_lstcsv)=0 %then %do;
> 606 proc contents data = affdx noprint out = recompute;
> 607
> 608 proc sql feedback noprint;
> 609 select distinct name into :lst_recompute
> separated ','
> 610 from recompute;
> 611 where name like 'datea%';
> 612 quit;
> 613 %put &lst_recompute;
> 614
> 615 data symputit;
> 616 set affdx;
> 617 by id;
> 618 call symput ("maxvars", (left(n(&lst_recompute)+1)));
> 619
> 620 data affdx;
> 621 update affdx test_merge;
> 622 by id;
> 623 datea&maxvars = datea;
> 624 %end;
> 625 %mend dolooping;
> 626
> 627 %dolooping
> SYMBOLGEN: Macro variable NME_LSTCSV resolves to
>
> datea01,datea02,datea03,datea04,datea05,datea06,datea07,datea0
> 8,datea09,date
> a10,date
>
> a11,datea12,datea13,datea14,datea15,datea16,datea17,datea18
> ERROR: Required operator not found in expression: nmiss(&nme_lstcsv)>0
> ERROR: The macro DOLOOPING will stop executing.
> 628 run;
>
> I apologize if this is really poorly written. Thank you for
> any suggestions
> you might have!
>
> Regards,
>
> Doug Cacialli
>
> ----------------------------------------------------------------------
> Doug Cacialli - Information Analyst / Laboratory Coordinator
> Sleep Research Laboratory
> Department of Psychiatry
> URMC - Strong Memorial Hospital
> 300 Crittenden Blvd.
> Rochester, New York 14642
> Phone - (585) 275-2900 Fax - (585) 273-3682
> ----------------------------------------------------------------------
>
>
Blue Cross Blue Shield of Florida, Inc., and its subsidiary and
affiliate companies are not responsible for errors or omissions in this e-mail message. Any personal comments made in this e-mail do not reflect the views of Blue Cross Blue Shield of Florida, Inc.
|