Q

Allow access to data from a stored procedure result set using COBOL or RPG

For COBOL and RPG programs to process the data after the stored procedure call completes, you need to direct the SQL stored procedure to place the result set in a global temporary table. COBOL and RPG cannot access embedded SQL as of V6R1.

In reference to this question and answer from 2005: Does COBOL or RPG currently allow access to data from a stored procedure result set?

If yes, can you provide a link to a manual that shows COBOL syntax?
Stored procedure result sets are still not accessible to COBOL and RPG programs using embedded SQL as of V6R1. IBM is working on this support for the next release.

Besides using the SQL call level interface APIs, another solution is having the stored procedure place the result set in a global temporary table. Then, the COBOL and RPG programs can process the data in the global temporary table after the stored procedure call completes. This result set technique is covered in more detail in the following IBM Redbook: Stored Procedures, Triggers, and User-Defined Functions on DB2 UDB for iSeries.
This was first published in June 2009

Dig deeper on iSeries COBOL programming

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchEnterpriseLinux

SearchDataCenter

Close