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!

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
  • 18 replies
  • 8580 views
  • 3 likes
  • 4 in conversation