Loop in procedure
Posted: Sat Oct 13, 2012 4:15 pm
Dear Tom,
I do want to implement a loop in a procedure which expands the estimation period by one month.
This is the simple procedure:
procedure taymodel series1 series2 series3 series4 series5 ibegin iend
type series series1 series2 series3 series4 series5
type int ibegin iend
do iend = firstob,iend
linreg(print) series2 firstob iend outge
#constant trend trend2
comp outget(iend)= outge(iend)
end do iend
end unit
But each time I try to pass series to the procedure I receive the error:
## SX23. Expected Variable/Element of Type INTEGER, Got Expression Instead
>>>>do iend = <<<<
There are apparentley problems with the loop, when I switch off the loop the error message disappears.
Whats wrong with the procedure, uisng the code in the main programm and not in the procedure works well.
Thanks a lot in advamce
I do want to implement a loop in a procedure which expands the estimation period by one month.
This is the simple procedure:
procedure taymodel series1 series2 series3 series4 series5 ibegin iend
type series series1 series2 series3 series4 series5
type int ibegin iend
do iend = firstob,iend
linreg(print) series2 firstob iend outge
#constant trend trend2
comp outget(iend)= outge(iend)
end do iend
end unit
But each time I try to pass series to the procedure I receive the error:
## SX23. Expected Variable/Element of Type INTEGER, Got Expression Instead
>>>>do iend = <<<<
There are apparentley problems with the loop, when I switch off the loop the error message disappears.
Whats wrong with the procedure, uisng the code in the main programm and not in the procedure works well.
Thanks a lot in advamce