BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
alepage
Barite | Level 11

Hello,

 

In one of my table, I was able to pick all the code that are used in our programs which may vary between 0 and 9 and between

a and z.

 

For example if my codelist = 1 2 3 4 x y z then I would like to find a way to obtains the one that are not in our codelist such as

0 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w.  How to do that?

 

Regards,

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Please explain more about how you have the current data.

If you have strings you might try the COMPRESS() function.

601   data test;
602     length all some rest $36 ;
603     all = collate(rank('0'),rank('9'))||collate(rank('a'),rank('z'));
604     some='345bcdegh';
605     rest=compress(all,some);
606     put (_all_) (=/);
607   run;


all=0123456789abcdefghijklmnopqrstuvwxyz
some=345bcdegh
rest=0126789afijklmnopqrstuvwxyz

View solution in original post

1 REPLY 1
Tom
Super User Tom
Super User

Please explain more about how you have the current data.

If you have strings you might try the COMPRESS() function.

601   data test;
602     length all some rest $36 ;
603     all = collate(rank('0'),rank('9'))||collate(rank('a'),rank('z'));
604     some='345bcdegh';
605     rest=compress(all,some);
606     put (_all_) (=/);
607   run;


all=0123456789abcdefghijklmnopqrstuvwxyz
some=345bcdegh
rest=0126789afijklmnopqrstuvwxyz

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

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1 reply
  • 689 views
  • 3 likes
  • 2 in conversation