Yes, there are always more than one ways to skin a cat, especially true in SAS, however, in most cases, one or two solutions stand out as the most suitable. To be honest with you, in your case, Proc SQL is among the most suitable approaches, as Cartesian product is what SQL does the best.
data have;
do id=1 to 30;
output;
end;
run;
proc sql;
create table want as
select * from have a, have(rename=id=id_b) b
where a.id ne b.id_b;
quit;
As for your Hash question, it turns out to be simple one. You will need to first define character variables such as CompC or CompB by the following:
length CompC CompB $ 20;
of course you need to tweak the actual length to match your data. Call missing alone only produces numeric variables by default unless you define it as Char in advance.
... View more