Actually looking at what your code is doing you should probably not be including the denominator variable in the array. Then it would not matter if it was before, after or in the middle of the list of numerator variables in the data vector. data share_three; set &cleaned_data(keep=store_id year quarter vol_g: vol_i: ); array share vol_g: ; do over share; if vol_i_0000 = 0 then share=0; else share = share / vol_i_0000 ; end; * Un comment next line if you want to force VOL_I_0000 to 1 as your previous code did ; * if vol_i_0000 ne 0 then vol_i_0000=1; run;
... View more