Is there a way to write a where statement to look at only certain positions in the text of a field? Maybe a example would be best.
Something like this works:
The results are phone numbers that are all 5's plus the ones where the middle 3 are 5's are returned.
But I'd like to find a cleaner way. Is there a way to say something like this?
Something like this works:
Code:
data want;
set have;
where (phone = '5555555555' or substr(phone,4,3) = '555');
run;
The results are phone numbers that are all 5's plus the ones where the middle 3 are 5's are returned.
But I'd like to find a cleaner way. Is there a way to say something like this?
Code:
data want;
set have;
where (phone in ('5555555555','***555****');
run;