LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: Ben <ben.dray@gmail.com>
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 ;


Back to: Top of message | Previous page | Main SAS-L page