
97Array Processing
ARRAY statement creates six new DATA step variables, ABOVE1 through
ABOVE6. The third ARRAY statement creates temporary data elements used
only for comparison purposes.
Program 6.6:
data ex6_6(drop = i);
set sbp2;
array sbp[6];
array above[6];
array threshold[6] _temporary_ (140 140 140 120 120 120);
do i = 1 to 6;
if (not missing(sbp[i]))
then above[i] = sbp[i] > threshold[i];
end;
run;
title 'Creating variables ABOVE1 − ABOVE6';
proc print data = ex6_6;
run;
Output from Program 6.6:
Creating variables ABOVE1 − ABOVE6
a a a a a a
b b b b b b
s s s s s s o o o o o o
O b b ...