How to avoid the "character in the Sass?

I have this variable in sas called saying. This variable contains the valueHello 'n Hi

I wrote the following code

data work.queryData;
 set work.actualData;
 if saying='Hello 'n Hi' then saying2='Hello and hi';
run;

How to avoid character 'in sas?

+4
source share
2 answers

Use the percent sign to avoid a single quote:

'Hello %'n Hi'
+4
source

Or double it ... works with single and double quotes.

data _null_;
  x = 'Hello' 'n Hi';
  y = "Hello. He said" "Hello" "then" "goodbye" "";
  put x =;
  put y =;
run;

x = Hello 'n Hi
y = Hello. He said "Hello" then "goodbye"
+5
source

Source: https://habr.com/ru/post/1526453/


All Articles