I have a procedure that loops through 2 sets of arrays and creates another by performing a calculation -
data New_Reg_Meas_Vol_Workload (drop=T_ACL--SL_WTG_BB SL_WTG_VOL--SL_FWO_VOL);
merge lookup.Unit_Times_Transpose(in=UnitTimes) New_Reg_Meas_Vol(in=MeasVols);
by Jurisdiction;
if UnitTimes and MeasVols;
array MeasVol (5) SL_WTG_VOL SL_NAO_VOL SL_ITV_VOL SL_FWC_VOL SL_FWO_VOL;
array UnitTime (5) SL_WTG SL_NAO SL_ITV SL_FWC SL_FWO;
array MeasWld (5) SL_WTG_WLD SL_NAO_WLD SL_ITV_WLD SL_FWC_WLD SL_FWO_WLD;
do i=1 to 5;
if MeasVol(i) = 0 then MeasWld (i) = 0;
else MeasWld (i) = (MeasVol(i)* UnitTime(i))/60;
end;
drop i;
output;
run;
For one of the variables I would like to perform a different calculation to the one referenced in the loop but I'm not sure if this needs to be done within the or can be done outside of it.
Thanks in advance.
data New_Reg_Meas_Vol_Workload (drop=T_ACL--SL_WTG_BB SL_WTG_VOL--SL_FWO_VOL);
merge lookup.Unit_Times_Transpose(in=UnitTimes) New_Reg_Meas_Vol(in=MeasVols);
by Jurisdiction;
if UnitTimes and MeasVols;
array MeasVol (5) SL_WTG_VOL SL_NAO_VOL SL_ITV_VOL SL_FWC_VOL SL_FWO_VOL;
array UnitTime (5) SL_WTG SL_NAO SL_ITV SL_FWC SL_FWO;
array MeasWld (5) SL_WTG_WLD SL_NAO_WLD SL_ITV_WLD SL_FWC_WLD SL_FWO_WLD;
do i=1 to 5;
if MeasVol(i) = 0 then MeasWld (i) = 0;
else MeasWld (i) = (MeasVol(i)* UnitTime(i))/60;
end;
drop i;
output;
run;
For one of the variables I would like to perform a different calculation to the one referenced in the loop but I'm not sure if this needs to be done within the or can be done outside of it.
Thanks in advance.