Date: Thu, 22 May 2008 11:30:26 -0400
Reply-To: "Fehd, Ronald J. (CDC/CCHIS/NCPHI)" <rjf2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J. (CDC/CCHIS/NCPHI)" <rjf2@CDC.GOV>
Subject: Re: INDEX
In-Reply-To: <c30f4d24-ad9c-4e26-bd7f-966ee9fae67e@x1g2000prh.googlegroups.com>
Content-Type: text/plain; charset=us-ascii
> From:
> Subject: Re: INDEX
>
> On May 22, 11:37 am, Aj <ajeetsubraman...@gmail.com> wrote:
> > Hi
> >
> > What does index(hit,'1')=2 do ?
>
> The INDEX function searches source, from left to right, for the first
> occurrence of the string specified in excerpt(that is '1')
> , and returns the position in source of the string's first character.
> If the string is not found in source, INDEX returns a value of 0.
> If there are multiple occurrences of the string, INDEX returns only
> the position of the first occurrence.
... so your expression is true only if there is a '1' in column two of
Hit
if index(hit,'1')=2 then putlog 'note2: one in column two';
else putlog 'note2: one not in column two';
Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov
|