DATA Step, Macro, Functions and more

String variable containing single and double quotation marks.

Reply
N/A
Posts: 0

String variable containing single and double quotation marks.

I want the string variable fstring1 to be:

'[select("r1c1:r10c1")]'. All quotation marks belong to the string.

The numeric variable lastrow has the value 10.

This expression doesn't work:

fstring1="'[select("r1c1:r" || strip(put(lastrow,3.0)) || "c1")]'".

In the expression I am trying to concatenate the 3 strings:

'[select("r1c1:r

strip(put(lastrow,3.0))

c1")]'.

Any suggestions?
Super Contributor
Posts: 474

Re: String variable containing single and double quotation marks.

Posted in reply to deleted_user
Try this:
[pre]
"[select(""r1c1:r" || strip(put(lastrow,3.0)) || "c1"")]"
[/pre]
Double every double quotes you wish to be represented within the string.

Same rule applies for sinqle quotes.

Cheers from Portugal.

Daniel Santos @ www.cgd.pt
Ask a Question
Discussion stats
  • 1 reply
  • 140 views
  • 0 likes
  • 2 in conversation