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


I'm using the EG Query builder to try to query a Character string composed as follows: 505546433549 to try to find that record.

What is the proper method to use to query in th above case?

I've tried using double quotes e.g. "505546433549" and single quotes '505546433549' without success

1 ACCEPTED SOLUTION

Accepted Solutions
mathias
Quartz | Level 8

I'm not sure to understand everything but

if you have a character variable with an observation containing '505546433549'

then in your querry filter you should be able to write

VariableX

Equal to

505546433549 (without quotes)

Enclose values in quotes (check this)


OR


"505546433549" (with quotes, double or single)

Enclose values in quotes (unchecked)


Does this help ?

View solution in original post

4 REPLIES 4
mathias
Quartz | Level 8

I'm not sure to understand everything but

if you have a character variable with an observation containing '505546433549'

then in your querry filter you should be able to write

VariableX

Equal to

505546433549 (without quotes)

Enclose values in quotes (check this)


OR


"505546433549" (with quotes, double or single)

Enclose values in quotes (unchecked)


Does this help ?

ChrisHemedinger
Community Manager

Like said, but in a picture:

filter.png

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
Ksharp
Super User

Maybe your variable contains some invisible character . try COMPRESS().

compress(var1, ,'kd') = "505546433549"

Xia Keshan

BillB
Fluorite | Level 6

All great points and answers.

Thank all of you!

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1659 views
  • 3 likes
  • 4 in conversation