Hello JFroberg,
Could you please execute the following code and let me know whether it fits your needs or not? Watch out: I did not check if all cases are taken into account but I think it could be a good starting point.
proc sort data=sashelp.shoes out=shoes_1;
by region product subsidiary;
run;
data shoes_2;
set shoes_1;
by region product subsidiary;
id = _N_;
run;
proc sql;
create table shoes_3 as
select distinct
t1.region, t1.product,
trim(left(t1.subsidiary)) || ' ' || trim(left(t2.subsidiary)) as Combinations
from (select id, region, product, subsidiary from shoes_2) t1
, (select id, region, product, subsidiary from shoes_2) t2
where t1.region = t2.region
and t1.product = t2.product
and t1.subsidiary >= t2.subsidiary
and t1.id > t2.id;
quit;
I hope it helps.
Regards,
Florent.
... View more