DATA Step, Macro, Functions and more

How can I Identify ( ♿) Symbol in data

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

How can I Identify ( ♿) Symbol in data

[ Edited ]

Hi

I have a data like this

             

             var1                                         var2

Room 192 - Seats 10 #                       5643

Room 307 - Seats 8                              768

Room 407 - Seats 8 ♿                         4324

Room 307 - Seats 8 §                          5612

Room number 192 - Seats 103 ♿        2111

 

And I need to make an Indicator variable Like

       Disabled = 1 if there is "♿" in Data

       Disabled = 0 If not

 

My Code

 

data work.&&outSRB&i.;

length Var1 $35 Var2 5

set work.&&midSRB&i.;

    if (scan(Var1, -1, ' ') = unicode("\u267f", "utf8") then Disabled=1;

    else Disabled=0;

run;

 

When I am running this it is showing

 

Disabled

0

0

0

0

0

 

Please I need your expert suggestions.

 


Accepted Solutions
Solution
‎12-05-2015 01:12 AM
Respected Advisor
Posts: 4,651

Re: How can I Identify ( ♿) Symbol in data

I'm no expert in this, but I would try 

 

Disabled = kindexc(Var1, "267f"x) > 0;

 

 

PG

View solution in original post


All Replies
Solution
‎12-05-2015 01:12 AM
Respected Advisor
Posts: 4,651

Re: How can I Identify ( ♿) Symbol in data

I'm no expert in this, but I would try 

 

Disabled = kindexc(Var1, "267f"x) > 0;

 

 

PG
Occasional Contributor
Posts: 6

Re: How can I Identify ( ♿) Symbol in data

Thank you so much.
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 233 views
  • 1 like
  • 2 in conversation