Date: Sat, 12 May 2012 09:16:45 -0400
Reply-To: Peter Timusk <petertimusk@PROGRAMDOCUMENTATION.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Peter Timusk <petertimusk@PROGRAMDOCUMENTATION.COM>
Subject: Perl match question. Using prxmatch to complete an if contains
statement.
Content-Type: text/plain; charset=us-ascii
Hello all
I was this morning hoping to do this
If x_char contains 'y' then var =1;
Apparently I can not use "contains" in an if statement.
So I use this
If substr(x_char, prxmatch(x_char,'y'), 1) = 'y' then var=1;
My question is what does the prxmatch function return for a position number, if it does not find the string you asked it to find? In other words will my if statement cough up too many errors when observations of x_char do not contain a 'y' character?
Peter Timusk
|