BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
P_Y
Calcite | Level 5 P_Y
Calcite | Level 5

How to filter out the number below start with "8187"? The format is string $CHAR8. Thanks

 

Example:

81861234

81876789

81886577

1 ACCEPTED SOLUTION
2 REPLIES 2
mkeintz
PROC Star

Try

where  string   ^=: '8187' ;

You can see more about the   =: operator at SAS Operators in Expressions

 

Go to the Character Comparisons link.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 638 views
  • 1 like
  • 3 in conversation