Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
Sending Large data in a Stored Procedure

Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message

New User

Joined: 09 Apr 2008
Posts: 83
Location: Chennai

PostPosted: Wed Oct 23, 2013 9:20 am    Post subject: Sending Large data in a Stored Procedure
Reply with quote

We're writing a new Cobol-DB2 stored procedure which has to return lot of data.
The data layout for my result-set is something as follows:
01 Result-Set
05 Static Data
05 Static Data10
05 Group 1 occurs 0 to 3 times depending on numItems
10 Group 1 variables
10 Group 1 variables
10 Group 2 occurs 0 to 10 times depending on numChars

Note: Since, it is a pretty big layout I am just giving a glimpse of how the layout is.

For a single call, the stored procedure may have multiple records with the above layout. So, let us say if the Input is Employee ID, I may have to return 2 records for that Input - one for the manager and the other for the employee. Sometimes, the hierarchy may go beyond the manager as well.

This stored procedure will be accessed by a Websphere program.
Now, I am thinking of returning the results in XML format. I do not want to store the output result-set in DB2 and hence I am not using the Db2 in-built XML functionalities. The reason is that this stored procedure may be called more than 10000 times in a day and I may never be requiring the I/O data. So, it will be pretty costly to save the I/O data in XML format in Db2. Hence, I want to process and return the output using a global-temp table.
Hence, I am planning to do the following:
1. Retrieve the data from various application tables and put the data in the above copybook layout
2. Use the COBOL XML Generate statement to generate the XML tags
3. Create a global-temp table with column type as CLOB. Insert the XML data in a CLOB column and then return the result-set to the calling system.

However, DB2 V10 for z/OS does not support CLOB column type in Global Temp table nor it supports the XML column type. So, I am stuck in the above plan.

There is another option for me - I can declare an O/P parm in the Stored Procedure for a CLOB/BLOB type variable and string all the XML result-sets (employee+manager) and pass the result-set using the CLOB/BLOB type. But that will limit the number of result-sets because the maximum length one result-set can be around 35000 bytes.

Is there any other option which I can take?
Back to top
View user's profile Send private message

Rohit Umarjikar

Senior Member

Joined: 21 Sep 2010
Posts: 2421
Location: NY,USA

PostPosted: Fri Dec 13, 2013 5:41 am    Post subject:
Reply with quote

split the data structure into multiple cursor's and let front end manage to prepare matrics as needed to display on the screen.
Something like a metadeta cursor and detailed data cursor. If I understand you rightly.
Back to top
View user's profile Send private message
Ed Goodman

Active Member

Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Fri Dec 13, 2013 9:21 pm    Post subject:
Reply with quote

I admit to being confused...

You don't want to store the data in DB2, so you're going to make a temp table?

Isn't a temp table still a table? Or are those now stored in memory?

You might call it 10000 times a day, but not need the output? If you don't need it, then why are you storing it every time?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1


Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts In JCL Procedure how we can execute R... Dhananjayulu Neeli CLIST & REXX 7 Sat May 16, 2020 12:01 am
No new posts Write 9(07) comp-3 data into output file clearskynot DFSORT/ICETOOL 4 Thu Apr 16, 2020 11:00 pm
No new posts COBOL batch program using large size ... Akriti Mishra COBOL Programming 3 Thu Mar 26, 2020 11:37 pm
No new posts Execute DSNTEP2 in REXX which is call... sushanth bobby CLIST & REXX 4 Wed Mar 04, 2020 3:27 pm
No new posts Outrec IFTHEN builds data in wrong po... saikarthik94 DFSORT/ICETOOL 6 Sun Mar 01, 2020 2:14 pm

Back to Top
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us