BookmarkSubscribeRSS Feed
Praveenit0808
Calcite | Level 5
what exactly I need is. Here is the problem:

Input name $ status ;
Cards;
Aa active
Aa active
Aa active
Aa active
Aa active
Bb deactivated
Bb deactivated
Bb deactivated
Dd deactivated
Dd deactivated
Ee active
Ee active
Ee active
Cc active
Cc active
;
Run;

O/p should be like this


Aa active
Aa active
Aa active
Aa active
Aa active
Cc active
Cc active
Cc active
Ee active
Ee active
Ee active
Ee active
Ee active
Cc active
Cc active

How do we do that?
5 REPLIES 5
Jagadishkatam
Amethyst | Level 16
try to use the below if condition

if index(status,'active')>0;
Thanks,
Jag
PeterClemmensen
Tourmaline | Level 20

If I understand your request correctly, you you want to do this:

 

Anytime status is active you dont do anything.

Anytime status is deactivated you want to alphabetically increase name, so that Aa becomes Bb and so on.

 

Am I correct?

Praveenit0808
Calcite | Level 5
It's not necessary the name should be in alphabetical order. If you look at
the raw data carefully what I need is whenever the status shows deactivated
it should be assigned to the person who is active.

##- Please type your reply above this line. Simple formatting, no
attachments. -##
Praveenit0808
Calcite | Level 5
It's not necessary the name should be in alphabetical order. If you look at
the raw data carefully what I need is whenever the status shows deactivated
it should be assigned to the person who is active.

##- Please type your reply above this line. Simple formatting, no
attachments. -##

SAS Innovate 2025: Register Today!

 

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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
  • 5 replies
  • 1285 views
  • 0 likes
  • 4 in conversation