I have been pulling my hair out with this. I want to create a macro that submits some SQL code. The SQL code contains a WHERE clause using the LIKE operator. I need to include a macro variable in the LIKE string. Here is what it looks like.
WHERE somefield LIKE "%&name%";
The resulting SQL code should look like
WHERE somefield LIKE "%jeff%";
Those two percent signs are killing me. Can anyone come up with a series of macro functions that would result in the string Im looking for? Your help is appreciated.
What you need is a QUOTING function. Quoting is the art of hiding characters, preventing the macro processor to do them wrong. In that case, %NRBQUOTE seems to work out fine.
WHERE name LIKE "%NRBQUOTE(%)&name%NRBQUOTE(%)" ;