DATA Step, Macro, Functions and more

SAS Universal Viewer, Filter Editor, Advanced -- Item Specification?

Accepted Solution Solved
Reply
Regular Contributor
Posts: 212
Accepted Solution

SAS Universal Viewer, Filter Editor, Advanced -- Item Specification?

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

 

 


Accepted Solutions
Solution
‎07-10-2016 09:10 PM
Regular Contributor
Posts: 212

Re: SAS Universal Viewer, Filter Editor, Advanced -- Item Specification?

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


All Replies
Trusted Advisor
Posts: 1,204

Re: SAS Universal Viewer, Filter Editor, Advanced -- Item Specification?

Hi,

 

Try this.

 

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

Regular Contributor
Posts: 212

Re: SAS Universal Viewer, Filter Editor, Advanced -- Item Specification?

Generated error:

 

The expression contains undefined function call substr().

 

 

Super User
Posts: 17,730

Re: SAS Universal Viewer, Filter Editor, Advanced -- Item Specification?

Try LIKE 

 

like '%_1'

Regular Contributor
Posts: 212

Re: SAS Universal Viewer, Filter Editor, Advanced -- Item Specification?

Reeza, error message:

 

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

 

 

Solution
‎07-10-2016 09:10 PM
Regular Contributor
Posts: 212

Re: SAS Universal Viewer, Filter Editor, Advanced -- Item Specification?

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?

 

 

 

 

Super User
Super User
Posts: 6,495

Re: SAS Universal Viewer, Filter Editor, Advanced -- Item Specification?

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.

 

Super User
Posts: 5,254

Re: SAS Universal Viewer, Filter Editor, Advanced -- Item Specification?

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
Regular Contributor
Posts: 212

Re: SAS Universal Viewer, Filter Editor, Advanced -- Item Specification?

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.

 

Super User
Super User
Posts: 6,495

Re: SAS Universal Viewer, Filter Editor, Advanced -- Item Specification?

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)

 

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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