u need to declare the cursor in the subpgm also. since u r going to compile it independently u need to define it in subpgm also. and having the same cursor in main and sub program will not show any error. but during the linking section it will show the error. i have not yet came across this situation but up to my knowld i have expl.