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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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