FNAME LNAME DISPLAY_NAME _TEMA001
Adam Smith Adam Smith 0
The reference for 'FIND' states: "substring
is a character constant, variable, or expression that specifies the substring of characters to search for in string."
Which leads me to think that is can be used as in the second query, which should be finding the lname value 'Smith' in the display_name string 'Adam Smith'
It doesnt, there is nothing in the log to report an error, the function just doesnt seem to work as described in Proc Sql? None of the similar character matching SAS functions will work with a variable as the substring either.
For reference I am using EG as the query tool.
You might consider using the TRIM function around the variable string that you are searching for. Consider the program below. Without the TRIM function, the length of ALTPIECE is $8 and 'ne ' is not found in anybody's name. SAS does not automatically trim trailing blanks for you in comparisons of this nature.