BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kstatju
Fluorite | Level 6

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

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

 

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

 

 

PG

View solution in original post

2 REPLIES 2
PGStats
Opal | Level 21

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

 

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

 

 

PG
kstatju
Fluorite | Level 6
Thank you so much.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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