In the cars dataset from SASHELP, I wand to find any MODEL observation that contains "Cent" or "Quatt". I tried different find options and FIND looks to work to find one of the strings I am searching for. How may I search for multiple strings using one FIND function?
I think of a practical example when I may want to find articles based on keywords. For example, all articles that have "gene" "genetic" "genetically" "allele" "genes" "inherited" "history" in their title where the title is a character variable in a SAS dataset.
Thank you for your help!
data cars;
set sashelp.cars;
run;
data cars_model;
set cars;
Model_up=upcase(Model);
model_var_f = find (Model_up, "CENT");
model_var_fw = findw (Model_up, "CENT");
model_var_i = index (Model_up, "CENT");
model_var_ic = indexc (Model_up, "CENT");
model_var_iw = indexw (Model_up, "CENT");
run;
proc freq data=cars_model; tables model_up; run;
proc freq data=cars_model; tables model_var_f model_var_fw model_var_i model_var_ic model_var_iw; run;
... View more