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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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