Hi ballardw (Super User), Thanks for your code. Sorry for the typos. I have corrected PARREN and PATERN as POSITION. I aim to create a SAS data set from a PROC HTTP-generated output text file using an IF-THEN DELETE statement. But first, I want to create a POSITION variable using the PRXMATCH function using the variable STRING (Please see the code in the DATA step below). I desire SAS to return a non-zero value for the POSITION variable if the STRING contains text like “HC-226, “HC-085A, or “HC-028 provided the STRING value does not contain Replaced or CD-ROM. Otherwise, I want SAS to return a zero for the POSITION variable. However, if the STRING value contains text like Replaced or CD-ROM, I want a zero for the POSITION variable. My first attempt seems to work if the STRING contains the text like the following: “HC-226, “HC-085A, “HC-028 … and the STRING value does not contain Replaced or CD-ROM. position=prxmatch('m/"HC-\d{3,}/i',string); Issue: I don’t know how to modify the above code to get a zero for the POSITION variable if the STRING value contains text like Replaced or CD-ROM.
... View more