Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums 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
rahuindo

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

Hi,
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: 1806
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 sending email from jcl using the mail... niloyarp JCL & VSAM 5 Tue Oct 10, 2017 12:32 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

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