Online File
Rick Aster: Professional SAS Programming Shortcuts: Contents
data main.int1; array dirn{12} $ 3 _temporary_ ('N' 'N-E' 'N-W' 'S' 'S-E' 'S-W' 'E' 'E-N' 'E-S' 'W' 'W-N' 'W-S'); array dcount{12} n n_e n_w s s_e s_w e e_n e_s w w_n w_s; retain dcount; set main.int2; by when; if first.when then do i = 1 to 12; dcount{i} = .; end; do i = 1 to 12; if dir = dirn{i} then dcount{i} = count; end; if last.when then output; run;