BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
5         
96         /*put into 3 buckets*/
97         data claims2;
98         set claims;
99         if PracticeName="Unknown" then ProvCategory="Not MMM";
100        else if PracticeName like "SonorTouch%" then ProvCategory="SonorTouchTech";
                                ____
                                388
                                76
ERROR 388-185: Expecting an arithmetic operator.

ERROR 76-322: Syntax error, statement will be ignored.

101        else ProvCategory="Private";
102        run;

IS there something else to use other than like?

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

LIKE only works in Proc SQL or the WHERE clause in a data step

If you want to check to see if a value begins with a specific text value use:

 else if PracticeName =: "SonorTouch" then ProvCategory="SonorTouchTech";

 Note the : after the =, that means "begins with"

View solution in original post

2 REPLIES 2
ballardw
Super User

LIKE only works in Proc SQL or the WHERE clause in a data step

If you want to check to see if a value begins with a specific text value use:

 else if PracticeName =: "SonorTouch" then ProvCategory="SonorTouchTech";

 Note the : after the =, that means "begins with"

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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
  • 2 replies
  • 935 views
  • 1 like
  • 2 in conversation