I'd like to isolate members of a column (character data) that END with a 1.
_21801_0
_22601_3
_23101_1
_21601_0
_22604a_1
_22502_2
_23403_1
_22004_0
It looks like this might be possible using one of the Operators in the pull-down menu, toward the bottom of the list.
Appears totally Greek to me.
Any help greatly appreciated.
Nicholas Komanik
Reeza, above, is basically correct. However, SAS Universal Viewer for some unknown reason wants to add to get it to work:
Convert([i_X],'System.String') like '%1'
That does the trick.
The other strange looking operators are still a mystery. If someone feels like explaining, please do. Perhaps at least the "IN" one?
Hi,
Try this.
data want;
set have;
flag=substr(strip(reverse(members)),1,1);
if flag=1;
run;
Generated error:
The expression contains undefined function call substr().
Try LIKE
like '%_1'
Reeza, error message:
Error in Like operator: the string pattern 'like '%_1'' is invalid.
Reeza, above, is basically correct. However, SAS Universal Viewer for some unknown reason wants to add to get it to work:
Convert([i_X],'System.String') like '%1'
That does the trick.
The other strange looking operators are still a mystery. If someone feels like explaining, please do. Perhaps at least the "IN" one?
SAS Universal Viewer is Windows tool. It is not really part of the SAS system. I assume the filtering syntax is driven by how that tool works. Most likely SAS adopted some existing package and hence the need to include Convert([i_X],'System.String') to reference a varaible instead of just using the variable name. Note that the GUI will generate that strange syntax for you so you do not need to type it yourself, just select the variable name from the list provided.
LinusH, exactly that "a quick browse of SAS files"....
Seems no documentation on those later-in-the-list Operators.
They appear to come from some other universe, not SAS itself.
What version are you using?
The LIKE operator in the FILTER gui tool worked for me using % as a wildcard.
I am usng version 1.4 (1.4.1.1410)
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.