Hey does anyone know how to resolve &Key to &animal (or animal) and not platypus and not key?
12 %let animal = platypus;
13 %let key = &animal.;
14
15 %put %str(&key.);
platypus
16 %put %nrstr(&key.);
&key.
Not sure what you mean.
If you want &KEY to resolve to animal then set it to animal.
%let key=animal ;
If you want include macro trigger in the value then quote the trigger. Your attempt with %STR(&animal) is quoting the result of the macro variable expansion.
%let key=%str(&)animal ;
The question from me would be why?
%let animal = platypus;
%let key = %nrstr(&animal.);
%put &key;
Ahhh thank you Xia. This will work for what we need.
Inheriting large complicated programs is not much fun.
To all, thank you for responding.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.