try this. It use Array, Do loop, and output statements
data loopdate (keep= d1 d2 d3);
array L1{5} (0 1 3 5 6);
array L2{6} (0 2 4 5 7 9);
array L3{3} (1 3 6);
do i = 1 to 5 ;
do j = 1 to 6;
do k = 1 to 3;
d1 = L1(i);
d2 = L2(j);
d3 = L3(k);
output;
end;
end;
end;
run;
proc print data=loopdate;
run;
output
Obs d1 d2 d3
1 0 0 1
2 0 0 3
3 0 0 6
4 0 2 1
5 0 2 3
6 0 2 6
7 0 4 1
8 0 4 3
9 0 4 6
10 0 5 1
11 0 5 3
12 0 5 6
13 0 7 1
14 0 7 3
15 0 7 6
16 0 9 1
17 0 9 3
18 0 9 6
19 1 0 1
20 1 0 3
21 1 0 6
22 1 2 1
23 1 2 3
24 1 2 6
25 1 4 1
26 1 4 3
27 1 4 6
28 1 5 1
29 1 5 3
30 1 5 6
31 1 7 1
32 1 7 3