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

Hi 

I have a big dataset with a column that have different string in the same row seperated with a comma e.g.:

Column

test xx (0+ år),test xx 2-12 ,xx xx (0+ )

I need a code that can say if the Column contains "test xx (0+ år)," then call it "good" 

 

So in this case the result willl be:

 

column

Good

1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

See if you can use this as a template

 

data have;
input x $50.;
datalines;
test xx (0+ år),test xx 2-12 ,xx xx (0+ )
test xx (2+ år),test xx 2-12 ,xx xx (0+ )
test xx 2-12,test xx (0+ år) ,xx xx (0+ )
;

data want;
   set have;
   if find(x, "test xx (0+ år)") then y = "Good";
run;

View solution in original post

3 REPLIES 3
PeterClemmensen
Tourmaline | Level 20

See if you can use this as a template

 

data have;
input x $50.;
datalines;
test xx (0+ år),test xx 2-12 ,xx xx (0+ )
test xx (2+ år),test xx 2-12 ,xx xx (0+ )
test xx 2-12,test xx (0+ år) ,xx xx (0+ )
;

data want;
   set have;
   if find(x, "test xx (0+ år)") then y = "Good";
run;
mmea
Quartz | Level 8

Thank you. It worked. have a good day