Take the example code below containing customers and their devices: data test;
length cust dev $5;
input cust $ dev $;
datalines;
a 1
a 2
a 7
b 2
b 3
c 3
d 4
e 5
h 2
x 4
;
run; I'm trying to group ALL related individuals by customer and device into unique IDs. For example, Customer A is related to Customer B through Device 2, and Customer B is related to Customer C through Device 3. Because A is related to B and B is related to C, these should have the same UID. If you think of customer as the 'parent' and device as the 'child' in node structure, all linked children and parents should be in the same UID. Any breaks should be separate UIDs. Below is the desired output: Customer|Device|UID
a 1 UID1
a 2 UID1
a 7 UID1
b 2 UID1
b 3 UID1
c 3 UID1
h 2 UID1
d 4 UID2
x 4 UID2
e 5 UID3 I have tried transposing by Customer and doing a 'cascade' retain on customer and device but the code gets pretty hairy. Also, I do not have access to PROC BOM which I've read may help my case. Does anyone have any ideas on how this might be achieved?
... View more