Your syntax is wrong - try one of the 2 altenatives (must be modified for your need)
1)[pre]
do i=1 to 5;
if Rate(i)=0 then
UnmeasVol(i) = 0;
else
select (i);
when (4)
UnmeasVol(4) = TotMeasWld / (ExSuccVol + ExUnsuccVol + NewSuccVol+ NewUnsuccVol) * (ExBookedConv + NewBookedConv)*Rate(i);
when (5)
UnmeasVol(5) = Ex_Reg_Meas_Workload.SL_NAO_WLD + New_Reg_Meas_Workload.SL_NAO_WLD;
Otherwise
UnmeasVol(i)=TotMeasRegWld * Rate(i);
end;
if ExSuccVol + ExUnsuccVol + NewSuccVol + NewUnsuccVol = 0 then UnmeasVol(4) = 0;
end;
[/pre]
2)[pre]
do i=1 to 5;
if Rate(i)=0 then
UnmeasVol(i) = 0;
else
select (i);
when (4)
do;
if ExSuccVol + ExUnsuccVol + NewSuccVol + NewUnsuccVol = 0 then UnmeasVol(4) = 0;
else
UnmeasVol (4) = TotMeasWld / (ExSuccVol + ExUnsuccVol + NewSuccVol+ NewUnsuccVol) * (ExBookedConv + NewBookedConv)*Rate(i);
end;
when (5)
UnmeasVol(5) = Ex_Reg_Meas_Workload.SL_NAO_WLD + New_Reg_Meas_Workload.SL_NAO_WLD;
Otherwise
UnmeasVol(i)=TotMeasRegWld * Rate(i);
end;
end;
[/pre]
More info at
http://support.sas.com/onlinedoc/913/getDoc/da/lrdict.hlp/a000201966.htm