BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Astounding
PROC Star

I'm not sure what you want to have happen when you hit a "101".  If you want all your "part#" variables to remain missing, just skip doing anything for the "101"s:

 

DO i=1 to 54;
   	if original{i} ne '101' then DO j=1 to 3;
      new{i,j} = substr(original{i}, 2*j-1);
   	END;
	END;
	
	DROP 
	i j;
_maldini_
Barite | Level 11

@Astounding Thank you for sticking w/ me. I appreciate your efforts to guide me towards figuring it out for myself. 

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
  • 31 replies
  • 8101 views
  • 17 likes
  • 6 in conversation