BookmarkSubscribeRSS Feed
Reeza
Super User

If value is not found whichN defaults to 0, as stated in documentation.  So add an if statement to set it to . 

 

Var = WhichN...;

If var=0 then var=.;

 

 

whilted
Calcite | Level 5
This worked PERFECTLY. Thank you!!!

Another quick question--since my main concern is having to "list" all the variable names of my dataset in the array, is it possible to "index" which variable names to include or to indicate a range (e.g., home to heat, so all the variables between home and heat are included, inclusively)?
whilted
Calcite | Level 5
Just saw this. I will definitely try this out soon! Thank you!

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 18 replies
  • 10850 views
  • 3 likes
  • 4 in conversation