BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
ama220
Obsidian | Level 7

Hello:

 

I have a set of variables that start with the same prefix. I would like to drop some of them.

 

E.g., Variables are   AC1  AC2  AC3  AC4 ...... AC100.

 

I'd like to retain the first 10 ACx variables and delete the rest after that.

 

Thanks for your help!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
2 REPLIES 2
PaigeMiller
Diamond | Level 26
drop ac11-ac100;
--
Paige Miller
ama220
Obsidian | Level 7
Thanks! I was tried the same code but on a different dataset. No wonder it did not work earlier.

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
  • 2 replies
  • 1175 views
  • 0 likes
  • 2 in conversation