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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 969 views
  • 0 likes
  • 4 in conversation