I have a dataset that has 415 columns. 15 are computed indicators and the 400 others are numerators and denominators of indicators I want to compute. The 400 variables all have the same format i.e. *variable-name*_NUM and *variable-name*_DEN. For example, from A_NUM and A_DEN I want to compute A = divide(A_NUM, A_DEN). In other words, from the initial 415 columns, I want to end up with 15 (already computed indicators) + 200 (400/2) indicators on my data set.
At the moment I am computing them manually as follow:
data want;
set have;
a = divide(a_NUM,a_DEN);
b = divide(b_NUM,b_DEN);
c = divide(c_NUM,c_DEN);
...
y = divide(y_NUM,y_DEN);
z = divide(z_NUM,z_DEN);
...
run;
But I am sure there is a dynamical way of doing this (maybe using arrays?).