IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Global Temporary table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Rsriram1982

New User


Joined: 08 May 2010
Posts: 3
Location: Chennai

PostPosted: Sat May 08, 2010 10:52 am
Reply with quote

Hi,

I am using a Global temporary table which is being created/dropped in the COBOL sub-program itself.

This sub-program is getting called for more than 12,000 times in one scenario. However, after 11758 times, the sub-program is getting abended with a sqlcode as -904.

Is there any limitations with number of times a Global temp tables (or session table) to be created and/or dropped in one execution of the main program? If so, is there a way to increase this limit or can any one of you give me an option to solve this issue?

Thanks!!!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat May 08, 2010 10:59 am
Reply with quote

Hello and welcome to the forum,

Which resource is not available? What is the reason code?

How many rows are insereted into this temporary table each time thru?

You might look here:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/dsnsqk10/5.129
Back to top
View user's profile Send private message
Rsriram1982

New User


Joined: 08 May 2010
Posts: 3
Location: Chennai

PostPosted: Sat May 08, 2010 11:04 am
Reply with quote

Hi, I am sorry. It was a typo in my 1st msg. I got a -204 sqlerror, which looks to be like the temporary table is not getting declared.

We executed the program multiple times and the insertion into the temporary table varies, but the number of times the sub-program being called remained at 11758.

1st time inserted around 35k times into the temp table.
2nd time inserted around 25k times into the temp table.

Thanks!!
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Sat May 08, 2010 5:46 pm
Reply with quote

Rsriram,

Can you show us your code, especially the declaration of DGTT.
We also like to know the reason code for the error.

Are you doing any commits while inserting into the table.

Sushanth
Back to top
View user's profile Send private message
Rsriram1982

New User


Joined: 08 May 2010
Posts: 3
Location: Chennai

PostPosted: Sun May 09, 2010 9:55 am
Reply with quote

Hi All,

We have found a solution for this problem. Instead of creating and dropping the temporary table everytime the sub program is called, we modified in such a way that the table will be created & dropped only once (for any number of sub-programs). Now the program is running fine for even 37000 records.


Thanks for showing interest on this forum!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun May 09, 2010 10:00 am
Reply with quote

Good to hear it is working - thank you for letting us know icon_smile.gif

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top