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

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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1016 views
  • 1 like
  • 3 in conversation