I'm just trying to combine two macro commands with quotation marks, but it seems like this is not an easy path.
Let's say that we have:
%LET VAR1="This is not the greatest song in the world"; %LET VAR2="this is just a tribute."; %LET TRIBUTE=%SYSFUNC(CATX(%STR( ),&VAR1,&VAR2)); %PUT &TRIBUTE;
I really want:
"This is not the greatest song in the world this is just a tribute."
But the above code really gives:
"This is not the greatest song in the world" "this is just a tribute."
So I'm trying to put %QUOTE() , %BQUOTE , etc. around &VAR1 and %VAR2 in the hope of exposing quotes, but I get the same result.
The only thing that works for me is:
%LET TRIBUTE="%SUBSTR(&VAR1.,2,%LENGTH(&VAR1.)-2) %SUBSTR(&VAR2.,2,%LENGTH(&VAR2.)-2)";
But it is ugly and can be very fast. Isn't there a better way to do this?
source share