I'm working with meetings data that is formatted as follows: Data: MeetingListHave MeetingNo PersonNo RoleNo 0001 01 01 0001 02 02 0001 03 05 0002 01 01 0003 01 01 0004 01 01 0004 02 02 0004 03 02 0005 01 01 0006 01 01 0006 02 05 Every MeetingNo will always have a PersonNo 01 with RoleNo 01, but after that first person there can any number of people. Each person has exactly one role, but there can be more than one person with the same role (excluding RoleNo 01, which will always be exclusive to PersonNo 01). The available roles are 01,02,03,04,05. I am trying to get a database where only meetings where a person with RoleNo 05 was present. I want all the PersonNos who attended that meeting, not just the person with RoleNo05. Given the dataset above I would want the final data to look like this: Data: MeetingListWant MeetingNo PersonNo RoleNo 0001 01 01 0001 02 02 0001 03 05 0006 01 01 0006 02 05 I've gotten as far as doing proc sort data=meetinglisthave out=meetinglistsorted; by MeetingNo descending RoleNo; run; so that if there is a person with the 05 role they are always in the first.meetinglistsorted position, but I don't know where to go from there. Thanks for any help you can give, I can provide more details if needed.
... View more