As already mentioned, it's hard to say what you need from the question. inlist() may work, or it may not match the setting.
I find the features of the Stata macro lists invaluable. Store your list in a macro (local or global), and then a set of useful commands :
local list abcdde local search c local search_in_list : list search in list di `search_in_list'
They can be calculated on the fly:
if `: list search in list' { actions if true }
Keith source share