Cursor remain open or close when control returns to calling program
What is the "real" question here?
How will it matter to pgmA if a cursor opened by pgmB is closed or not? PgmA cannot "continue" Fetching from the pgmB cursor. . .
If we understand what you want to attempt/address, someone may have a suggestion.