If you are supposed to be looking for specific values then you should share the specific values you are using.
"Get the CONTNAME variable with the following values, without using any formats". My first thought would be to use an INFORMAT, which is not a Format, but I suspect that you are supposed to build a table with the actual values of the CONTNAME variable and the associated values you want to use as part of join to get the desired values. The easiest way to do that would likely be a data step reading the paired values.