Thanks that works perfectly! It outputs the rows and includes the tilde characters. I've been trying to add a line to exclude keywords to reduce the dataset. I've tried the following but this is not working, do you have suggestions for an alternative? data work.new;
if _n_=1 then
do;
dcl hash h1(dataset:'work.have(where=(find(cats(var_1),"keyword","i") and not find(cats(var_1), "keyword_2", "i")))'); ))');
h1.defineKey('event_id');
h1.defineDone();
end;
set work.have;
if h1.check()=0;
run; Example dataset
ID Num_1 Num_2 Char_1 Char_2 Char_3 Char_4 Char_5
145896555 19 25 A Text Text Text Text
145896555 19 25 B Text Text Text Text
145896555 19 25 B Text Text Text Text
145896555 19 25 B Text Text Text Text
145896555 19 25 B Keyword_1 Text Text Text
145896555 19 25 B Text Text Text Text
145896556 19 25 A Text Text Text Text
145896556 19 25 B Text Text Text Text
145896556 19 25 B Text Text Text Text
145896556 19 25 B Text Text Text Text
145896557 19 25 B Text Text Text Text
145896557 19 25 B Text Text Text Text
145896557 19 25 B Text Text Text Text
145896557 19 25 A Text Text Text Text
145896557 19 25 B Text Text Text Text
145896558 19 25 B Keyword_1 Text Text Text
145896558 19 25 B Keyword_2 Text Text Text
145896558 19 25 B Text Text Text Text
145896558 19 25 B Text Text Text Text
145896559 19 25 B Text Text Text Text
145896559 19 25 B Text Text Text Text
145896559 19 25 B Text Text Text Text
145896559 19 25 B Text Text Text Text
I'd like the output dataset to read:
145896555 19 25 A Text Text Text Text
145896555 19 25 B Text Text Text Text
145896555 19 25 B Text Text Text Text
145896555 19 25 B Text Text Text Text
145896555 19 25 B Keyword_1 Text Text Text
145896555 19 25 B Text Text Text Text
... View more