data a;
do i=1 to 7;
do j=1 to 7;
if i^=j then output;
end;
end;
run;
proc sql;
create table final as
select *,(i*j) as newvar from a where i<>j;
quit;
data xxxx ;
set xxxx ;
array orig{7} &vname;
array comb{21} &_name_;
n=0;
do i=1 to dim(orig)-1;
do j=i+1 to dim(orig);
n+1;
comb[n]=orig[i]*orig[j];
end;
end;
drop i j n;
run;