Im having a problem with the ampersand quoted after then in the statement below because i've used double quotes SAS thinks that the ampersand is the start of a macro, now the usual way to get round it would be to use single quotes but i can't do this because Italy has an apostrophe and SAS think its end of quote. is there a way of getting round this?
Case
When TotalTours.Brand = "J" and TotalTours.Description = 'Innsbruck & Lake Garda' then "Innsbruck & Italy's Lake Garda" end
the base SAS language includes a function to "hide" the ampersand from normal macro variable handling.
However, since your code is not executing within a macro, the solution is even simpler: Just use single quotes (and repeat any embedded single quote)
Try [pre] then 'Innsbruck & Italy''s Lake Garda' [/pre]
Single quotes is sure the easiest solution here.
I think what Peter_c is talking about is %nrstr(....).
This means NoResolveString: The macro processor won't resolve the string - especially characters like '&' and '%' with meaning in SAS macro language - but single quotes have the same effect.
HTH
Patrick
The 2025 SAS Hackathon Kicks Off on June 11!
Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.