When you have a question you need to start a new topic in the appropriate part of the forum rather than "tag it on" to something else you are posting in some unrelated part of the forum. . .
This has been split and moved to the db2 part of the forum (which is hopefully where it should be).
Your question is not at all clear. . . If you want to stop after processing 50 rows, maintain a count and FETCH no more when your limit is reached (50 in this example).
Hope this helps,