morinia
asked on
Wildcard "if" statement in SAS
How do I check a field in SAS equal to anything with the word "Parent" or "p_" in the field?
ASKER
The above solution did not work.
ASKER
I was able to use substring to check for the first csix characters. I can;t figure out how to check if unknown as to where in the string a particualr subset is.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Bradanelson,
Is index being set in a loop?
Is index being set in a loop?
I don't understand your last question. The IF statement I gave will be true if Parent or p_ is anywhere in the value of fieldname. Replace fieldname with your field and add the statement or statements after the THEN in your code.
ASKER
It worked fine!!
IF (NAME = :"STR" )
Will match if the field name starts with STR. I'm not sure you can do something like:
IF (NAME = :"STR":) if it would match if the field name contains "STR" anyplace.