Date: Mon, 28 Oct 2002 09:48:50 -0800
Reply-To: Dale McLerran <stringplayer_2@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Dale McLerran <stringplayer_2@YAHOO.COM>
Subject: Re: tip v9.1 new macro features
In-Reply-To: <02ce01c27ea1$934b1140$66c8a8c0@gusher>
Content-Type: text/plain; charset=us-ascii
David Ward posted an IN macro a while back. The archived message
http://listserv.uga.edu/cgi-bin/wa?A2=ind0006D&L=sas-l&P=R24086
gives what appears to be his most up-to-date version.
Dale
--- Kevin Myers <KevinMyers@AUSTIN.RR.COM> wrote:
> I don't have any source code handy at the moment, but these macros
> are not
> anything too amazing or tricky. They don't make the macro act like a
> true
> operator. They are typically of the form:
>
> %in(<search value>, <list of values>)
>
> Most make use of some variation on %SCAN(), %INDEX(), and/or
> %sysfunc(INDEXW()). Make sense?
>
> s/KAM
>
>
> ----- Original Message -----
> From: "roland.rashleigh-berry" <roland.rashleigh-berry@NTLWORLD.COM>
> Newsgroups: bit.listserv.sas-l
> To: <SAS-L@LISTSERV.UGA.EDU>
> Sent: Monday, October 28, 2002 10:33 AM
> Subject: Re: tip v9.1 new macro features
>
>
> > Could you please cite the code for one of those %in() macros here?
> I would
> > be very interested.
> >
> >
> > "Kevin Myers" <KevinMyers@AUSTIN.RR.COM> wrote in message
> > news:02a101c27e9c$c624e5a0$66c8a8c0@gusher...
> > > I'm fairly certain the primary reason that the %IN() operator is
> being
> > > delayed or canceled is due to the large number of users that
> ALREADY
> have
> > a
> > > macro named %IN() that in many cases does something similar to
> what the
> > new
> > > %IN() operator was supposed to do. Considering that, I might
> tend to
> > agree
> > > with Quentin, who questioned the reasoning behind a %IN()
> operator as
> > > opposed to an IN() operator (no % sign).
> > >
> > > Also, IMHO the implementation of the %IN() operator that had been
> chosen
> > was
> > > somewhat flawed. Although there were reasons that the particular
> > > implementation was selected, it could not deal well with
> arguments that
> > had
> > > imbedded blanks. This is because the chosen implemention treated
> the
> list
> > > to be searched as one string containing a series of blank
> delimited
> > values,
> > > rather than as a true comma delimited list of separate arguments.
> > >
> > > The chosen implementation had been selected because it was
> relatively
> > quick
> > > and easy to implement. I can't remember the details at the
> moment, but
> I
> > > was told that there were apparantly some significant macro parser
> issues
> > in
> > > attempting to deal with a true argument list. I can't say
> whether or
> not
> > > the same would be true regarding an IN() operator without the %
> sign.
> > >
> > > s/KAM
> > >
> > >
> > > ----- Original Message -----
> > > From: "roland.rashleigh-berry"
> <roland.rashleigh-berry@NTLWORLD.COM>
> > > Newsgroups: bit.listserv.sas-l
> > > To: <SAS-L@LISTSERV.UGA.EDU>
> > > Sent: Monday, October 28, 2002 9:29 AM
> > > Subject: Re: tip v9.1 new macro features
> > >
> > >
> > > > "Fehd, Ronald J. PHPPO" <rjf2@CDC.GOV> wrote in message
> > > > news:9D17D648E4EBD311AD45009027D0DF93050021E5@MCDC-ATL-64...
> > > > > a little birdie chirpeth:
> > > > >
> > > > > > The %IN operator has been postponed to V9.1, or later.
> > > > > i.e.: %IF &VAR %IN(A B C) %THEN
> > > > >
> > > > > > a note will be issued when a macro is named IN.
> > > > >
> > > > > i.e. %MACRO IN(...);
> > > > > Heads up! Dale!
> > > >
> > > > I don't think this is possible with a macro. It would have to
> be
> written
> > > > into the macro interpreter itself because it would have to keep
> the
> > > > knowledge of what &VAR was while looking at what was defined to
> %IN().
> > Any
> > > > macro you would write would not be aware of what just preceded
> it in
> the
> > > > macro code. How could it possibly pick this up?
> > > >
> > > > You could always do it like this:
> > > >
> > > > %IF %INDEX(%quotelst(A B C),"&VAR") %THEN...
> > > >
> > > > ...so long as you use the %quotelst macro here.
> > > > http://www.sconsig.com/sastips/roland_rashleigh-berry/
> > > >
> > > > If this is not the case then I would be happy to be proved
wrong.
=====
---------------------------------------
Dale McLerran
Fred Hutchinson Cancer Research Center
mailto: dmclerra@fhcrc.org
Ph: (206) 667-2926
Fax: (206) 667-5977
---------------------------------------
__________________________________________________
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/
|