BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
NKormanik
Barite | Level 11

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
NKormanik
Barite | Level 11

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?

 

 

 

 

View solution in original post

9 REPLIES 9
stat_sas
Ammonite | Level 13

Hi,

 

Try this.

 

data want;
set have;
flag=substr(strip(reverse(members)),1,1);
if flag=1;
run;

NKormanik
Barite | Level 11

Generated error:

 

The expression contains undefined function call substr().

 

 

NKormanik
Barite | Level 11

Reeza, error message:

 

Error in Like operator: the string pattern 'like '%_1'' is invalid.

 

 

NKormanik
Barite | Level 11

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?

 

 

 

 

Tom
Super User Tom
Super User

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
Tourmaline | Level 20
Universal Viewer is primarily to do a quick browse of SAS files. Don't expect it to support any advanced filtering etc.
May I ask what you try to accomplish with this tool, since you take the time to start a thread around it...?
Data never sleeps
NKormanik
Barite | Level 11

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.

 

Tom
Super User Tom
Super User

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)

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 9 replies
  • 3012 views
  • 4 likes
  • 5 in conversation