UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi !
The cursor is not closes unless the logical unit of work (LUW) is ended.
In your example, the sub-pgm has to open and close the cursor for correct handling. If you write sub-pgms for getting data from db2 perhaps do it like this:
main -> call sub, function=Open / sub do the open and goback
main -> call sub, function=Fetch / sub does a fetch and goback
... with data in comarea
main processing data
main -> call sub, function=Fetch / sub does fetch and returns 100 EOF
main -> calls sub, Function=Cole / sub closes cursor
Hope it helps, regards, UmeySan |
|