I'm just trying to concatenate two quoted macro variables but there doesn't seem to be an easy way.
Say 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 actually want:
"This is not the greatest song in the world this is just a tribute."
But the above code actually yields:
"This is not the greatest song in the world" "this is just a tribute."
So I try putting %QUOTE()
,%BQUOTE
,etc. around &VAR1
and %VAR2
in hopes of unmasking the 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 this is ugly and can get lengthy really fast. Is there not a better way to do this ?