Hello, I'm trying to search for multiple alphanumeric strings in a variable. There are two types of searches I want to do: 1. Search for only the specific string (e.g. E45 only, not any string that contains E45) and 2. search for any string that starts with a specified string of characters (e.g. any string that begins with E45). Once I identify any of these alphanumeric strings I want to flag it as 1 and if the strings are not present, I want the variable to be 0. I can't just copy and paste the data here for privacy reasons but it looks like this: data test; input alphanum $ ; datalines; G85.0;Z58.6;; ;; Z00.125;F80.14;F82.0; ;;;E66.09;H54.0;E66.9;E66.01; Z68.55 F20.96 F32O F331;Z68.55;Z67.56;Z74.89; run; I wrote code like this for each of the flags: if prxmatch('/^H5G|\bH5X.66\b|\bH5F.1G\b|^H5D\b/', icd10)>0 then test_flag=1; else test_flag=0; If there is a ^ then it should pull in any strings that begin with those letters and numbers. If the string is bordered by \b, then it should only flag it if that exact string appears. Some of the flags worked but some of them are flagging strings they should not be, completely unrelated strings. I did get this as a warning on some of the flags but am not sure how to fix it: NOTE: The quoted string currently being processed has become more than 262 characters long. You might have unbalanced quotation marks. Could this cause it? IS prxmatch just not meant to work with this kind of data and if so, is there another way to search multiple alphanumeric strings?
... View more