Back in 9.2 (?) we added CALL SYMPUTX, which automatically trims macro variables created with CALL SYMPUT. Yay!
However, %SYSFUNC( ) still can introduce annoying spaces and require multiple SYSFUNCs and/or multiple %LET statements.
So, let's have a new function, %SYSFUNCX( ) (and %QSYSFUNCX), which is just like regular %SYSFUNC, except the result is automatically trimmed (on both sides, so more like STRIP or CATS)?
That is not really needed as a simple %LET will strip them for you.
Try this code:
If you want to PRESERVE the leading and trailing spaces then use %Qsysfunc().
Sure, but if it's an argument inside a longer macro variable, that doesn't work. This came up on the SAS-L earlier today.
generates something like C:\yourdir\ June 10, 2013_Summary.csv
Removing the space requires either a second SYSFUNC, or a second macro variable - both really unneeded.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.