Hi Paul (et al.)
I think perhaps you're being a little bit too harsh on the macro documentation.
With a close reading, it defines three different "forms" of macro variable specification
Only the second and third form say that leading and trailing blanks are automatically trimmed (yes should be "stripped"). So that part is accurate. Definitely it should be updated to describe the <TRIMMED> option which is available for the first form.
data have ;
x=" foo " ;
run ;
proc sql ;
select x into :mvar1 from have ;
select x into :mvar2 trimmed from have ;
select x into :mvar3- from have ;
select x into :mvar4- notrim from have ;
select x into :mvar5 separated by " " from have ;
select x into :mvar6 separated by " " notrim from have ;
quit ;
%put >>&mvar1<< >>&mvar2<< >>&mvar3<< >>&mvar4<< >>&mvar5<< >>&mvar6<< ;
Returns:
>> foo << >>foo<< >>foo<< >> foo << >>foo<< >> foo <<
Which is consistent with the docs.
In the second form, since the upper bound is optional, I suppose it should be:
Kind Regards,
--Q.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.