|
Hi Jack,
For a solution see http://tinyurl.com/lot89
Regards - Jim.
--
Jim Groeneveld, Netherlands
Statistician, SAS consultant
home.hccnet.nl/jim.groeneveld
On Fri, 1 Sep 2006 10:03:56 -0400, Jack Clark <JClark@CHPDM.UMBC.EDU>
wrote:
>Good morning everyone.
>
>
>
>I am creating a new macro variable called NEEDC. If the last word in the
>formatted value of another macro variable (&WHCL) is 'City', 'State' or
>'County', I want the value of NEEDC to be blank. Otherwise I want the
value
>of NEEDC to be the word County;
>
>
>
>I have successfully tested and run the code below, simply checking for the
>word 'City' as the last word in the formatted &WHCL:
>
>
>
>%if %qscan( %bquote(%sysfunc(putc(&whcl,$cnty.))),-1,%str( ) ) = City %
then
>%do;
>
> %let needc =;
>
>%end;
>
>%else %do;
>
> %let needc = County;
>
>%end;
>
>
>
>
>
>When I tried to use the IN operator to check for 'City', 'State' or
>'County', I am getting an error message in the log that says "Required
>operator not found in expression". I have tried it with and without
quotes
>around the City, State and County :
>
>
>
>%if %qscan( %bquote(%sysfunc(putc(&whcl,$cnty.))) ,-1,%str( ) ) in
>(City,State,County) %then %do;
>
> %let needc =;
>
>%end;
>
>%else %do;
>
> %let needc = County;
>
>%end;
>
>
>
>
>
>I am not sure if this is related to the use of the IN operator in macro
>code, or if there is a macro quoting problem with the three terms in the
>parentheses. Can someone please give me some direction on this? I am
>interested in a solution to make the code work, as well as an explanation
as
>to why my existing code is not valid.
>
>
>
>Thank you.
>
>
>
>
>
>Jack Clark
>
>Research Analyst
>
>Center for Health Program Development and Management
>
>University of Maryland, Baltimore County
|