, are you sure it worked? It seems to me it can't.
array all(&&nmobs.) $;
The time point when this macro variable is supposed to be resolved, it does not exist yet. It only exists after SAS code " call symputx('nmobs',numobs*4);" being executed, which is way late for its call for being resolved.
You may try to clean up your existing macro variables and give another shot.
Haikuo
You probably will need to add an INPUT() function to convert the character string returned by VVALUEX() function back to a number.
Also there is risk of rounding of the value caused by the number/character/number conversion.
value=input(vvaluex(channel),32.);
@Reeza, can you help me get this? According to SAS documentation, vvaluex takes expression as argument. But here you have variable 'channel' as argument. I think vvalue only takes variable as argument. Thanks !
@SAS_inquisitive wrote:
@Reeza, can you help me get this? According to SAS documentation, vvaluex takes expression as argument. But here you have variable 'channel' as argument. I think vvalue only takes variable as argument. Thanks !
So how am I supposed to know what you're referring to in a 2 year old thread? You asked this earlier, please continue to post on that thread or start a new one. Answer to your question - what's an expression vs what's a variable.
@Reeza Thank you. I checked the documentation the expression specifies a character constant, variable, or expression that evaluates to a variable name.
Thank you guys,
it is amazing how many alternatives there exists to this problem
I think Reeza's solution is the most elegant, but thank you all for your ideas, I learned a lot.
Greetings
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.