Hi everyone! Could you please help me with this matter! I want to find a word within a text, if that word exist in the text, put 1 in a variable! for example, Id ReviewText Pillow Duvet 1 The Pillows was comfortable 1 0 2 The stake was good 0 0 3 Duvet and pillow was cheap 1 1 I used this code, but I keep receiving "Variable ReviewTextt has been defined as both character and numeric" error! data Final; set Final1(rename=(ReviewText=ReviewTextT)); ReviewText = put(ReviewTextT, 9999.); drop ReviewTextT; run; Data Final; length ReviewText $ 9999; data final0; Word = scan (ReviewText,1,'*'); if word in ('pillow' 'pillows') then Pillow=1; set final; run; Thanks in advance for helping! H
... View more