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"

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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