How do you select a range of characters in PROC SQL using the LIKE operator? For example: DATA test;
INPUT n x $;
cards;
1 abcd
2 1000
3 EF3H
4 _4*4
;
RUN;
PROC SQL;
SELECT n, x
FROM test
WHERE x LIKE "%[A-Z]%"
;
QUIT; Row 3 should be selected, but when I run it no rows are selected. EDIT: my main goal is to select rows in which there are letters in the string. I get that you could do if findc(lowcase(x),"abcdefghijklmnopqrstuvwxyz") > 0 in a data step, but just wondering if there's an equivalent in PROC SQL since I'm already using it to query a SQL database. Also I would want a flexible way of doing something like this, so maybe I'm looking for strings where any character could be between A and L, or J and X etc.
... View more