Date: Wed, 27 Aug 2008 17:19:02 +0530
Reply-To: Anindya Mozumdar <anindya.lugbang@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Anindya Mozumdar <anindya.lugbang@GMAIL.COM>
Subject: Re: Macro scanning
In-Reply-To: <c6a21915-1918-4f2a-af17-d2320fd3ba8e@k13g2000hse.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
I guess what you want is
scan("&ecchecks",'ABC') > 0 then..
if scan("&ecchecks",'DEF') > 0 then..
and so on.
SAS also provides a %scan function in case you want to avoid the data step.
On Wed, Aug 27, 2008 at 4:43 PM, Ben <ben.dray@gmail.com> wrote:
> Hi all,
>
> How am I able to scan a macro string for a particular substring? I'm
> looking to repeatedly scanning the macro variable in this style (but
> one that works):
>
> if scan(&ecchecks,'ABC') then do ;
> ....
> end ;
>
> if scan(&ecchecks,'DEF) then do ;
> ....
> end ;
|