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

yes, suppose, a patient had five operation with the types being the one u stated:
1->2->1->3->2

 

Then it should come out as an option 1->2->1->3->2, as Im interested in all changes

PaigeMiller
Diamond | Level 26
data want;
    set have;
    length group $ 256;
    array lead lead:;
    group=cats(lead(1));
    do i=2 to dim(lead);
        if lead(i)^=lead(i-1) then do;
            group=cats(group,'->',lead(i));
        end;
    end;
    drop i;
run;
--
Paige Miller
rookie21
Obsidian | Level 7

This did help. 

Thank you so much ! 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 17 replies
  • 1816 views
  • 0 likes
  • 3 in conversation