If you're interested, you can do the while split thing with no pre sorting using hash of hashes like this. Your data can't be too big though.
data have;
input ID $ var1 var2;
datalines;
one 100 200
one 100 200
three 300 400
three 500 200
three 200 100
two 400 200
two 300 166
one 300 100
three 400 400
;
data _null_;
dcl hash hh();
hh.definekey("id");
hh.definedata("h", "id");
hh.definedone();
dcl hiter i("hh");
do until (z);
set have end = z;
if hh.find() ne 0 then do;
dcl hash h(dataset : "have(obs = 0)", multidata : "Y", ordered : "Y");
h.definekey("var1");
h.definedata(all : "Y");
h.definedone();
hh.add();
end;
h.add();
end;
do while (i.next() = 0);
h.output(dataset : id);
end;
run;
... View more