BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Haikuo
Onyx | Level 15

, 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

art297
Opal | Level 21

and : You're both obviously correct! Whatever I had done worked before I posted the message, but I can't replicate it. The code fails miserably. Darn!

I must have somehow created the macro variable while I was testing various iterations of the code. Smiley Sad

Tom
Super User Tom
Super User

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.);

SAS_inquisitive
Lapis Lazuli | Level 10

@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 !

Reeza
Super User

@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. 

SAS_inquisitive
Lapis Lazuli | Level 10

@Reeza  Thank you. I checked  the documentation  the expression specifies a character constant, variable, or expression that evaluates to a variable name.

Edoedoedo
Pyrite | Level 9

Thank you guys,

it is amazing how many alternatives there exists to this problem Smiley Happy

I think Reeza's solution is the most elegant, but thank you all for your ideas, I learned a lot.

Greetings

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 21 replies
  • 20626 views
  • 13 likes
  • 9 in conversation