program define _3daxtbl version 2.1 mac def _n = _N mac def _n1 = _N + 1 mac def _new = _N + 9 set obs %_new gen byte _Type = cond(_n>=%_n1,2,.) #delimit ; replace _x= cond(_n==%_n+1 | _n==%_n+5 | _n==%_n+6 | _n>=%_n+8,1,0) in %_n1/l ; replace _y= cond(_n<=%_n+2 | _n==%_n+9, 1, 0) in %_n1/l ; replace _z= cond(_n==%_n+4 | _n==%_n+5, 1, 0) in %_n1/l ; #delimit cr end exit /* _3daxtbl [arguments ignored] adds "table-top" axis to the data. adds to the end of the data: input byte _Type _x _y _z 1 2 1 1 0 2 2 0 1 0 3 2 0 0 0 4 2 0 0 1 5 2 1 0 1 6 2 1 0 0 7 2 0 0 0 8 2 1 0 0 9 2 1 1 0 end */