I would like to use the %s and %l function to implement repetitive task using the dofor loop over the series R1 to R6, when I use the display instruction on the transpose of my calls, I get only NA. Please advise.
Thanks
Code: Select all
OPEN DATA "C: \ Desktop\ R11newset.xls"
DATA(FORMAT=xls,ORG = Col) / R1 R2 R3 R4 R5
OPEN DATA "C: \ Desktop\ Data_T1.xls"
DATA(FORMAT=xls,ORG=COL) 1 10964 S T1 div r2 T2 K
com M = 61, P=10964
dec rec a T3 ST Call Rtstr
dim a(M,4) T3(M,P) Rtstr(M,P) ST(M,P) Call(M,P)
dofor y = R1 to R6
boot entries 1 61 1 65360
set draw 1 61 = %s(%l(y)+"(entries)")
do i =1,M
com a(i,1)=S(i) , a(i,2)=T1(i), a(i,3)=div(i) , a(i,4)=r2(i)
do j =1, 10964
ewise T3(i,j) = T2(j)-T1(i)
ewise Rtstr(i,j) = (r2(i)-div(i)+draw(i))*T3(i,j)/365
ewise ST(i,j) = %if(T3(i,j)>0, S(i)*exp(Rtstr(i,j)),%na)
ewise Call(i,j) = %if(T3(i,j)>0,exp(-r2(i)*12*T3(i,j)/365)*%max(0,ST(i,j)-K(j)),%na)
end do j
end do i
end dofor y
dis tr(Call) y