Example
The following is an example of the ALLCOMB function.
data _null_;
array x[5] $3 ('ant' 'bee' 'cat' 'dog' 'ewe');
n=dim(x);
k=3;
ncomb=comb(n,k);
do j=1 to ncomb+1;
rc=allcomb(j, k, of x[*]);
put j 5. +3 x1-x3 +3 rc=;
end;
run;
SAS writes the following output to the log:
1 ant bee cat rc=0
2 ant bee ewe rc=3
3 ant bee dog rc=3
4 ant cat dog rc=2
5 ant cat ewe rc=3
6 ant dog ewe rc=2
7 bee dog ewe rc=1
8 bee dog cat rc=3
9 bee ewe cat rc=2
10 dog ewe cat rc=1
11 dog ewe cat rc=-1