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

Dynamic increase in internal table array size - COBOL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pravinj

New User


Joined: 10 Jun 2008
Posts: 24
Location: india

PostPosted: Wed Feb 11, 2009 9:32 pm
Reply with quote

Hey, i have an internal working storage array which will hold the entire DB2 table records in it. Currently the internal table size is fixed to be of some X times size. Now the size of the actual DB2 table (number of records) has increased beyond the specified X number of records in array declaration size.

Is only the manual updation of internal table size in the COBOL module a remedy?

Can you recommend any ways that can automate the increase in internal table size declared in program relatively to the increase in number of records in DB2 table? Thanks in advance..
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Feb 11, 2009 9:43 pm
Reply with quote

Quote:
Is only the manual updation of internal table size in the COBOL module a remedy?
Yes, unless you want to cobble together a GETMAIN function and work in LINKAGE instead of WORKING STORAGE....
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: Wed Feb 11, 2009 11:16 pm
Reply with quote

Hello,

Suggest you come up with a new design. At some point the table will probably become too large to fit into an internal array. And then it will be a crisis. . . You and your management and users will surely be less than happy. . . icon_neutral.gif

It is almost always rather poor design to load an entire table into memory. . .
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Wed Feb 11, 2009 11:54 pm
Reply with quote

Dick's advice is good, but I have some questions. Are you using ALL of the DB2 columns or are you loading unused columns into your table? Will the DB2 table usually increase or will it ever decrease?
Back to top
View user's profile Send private message
pravinj

New User


Joined: 10 Jun 2008
Posts: 24
Location: india

PostPosted: Thu Feb 12, 2009 10:15 am
Reply with quote

Thanks.
Module that i am working on is from vintage days icon_cry.gif . I cannot alter the module's design much.

It's a COBOL-BATCH module and they use internal array table to load the internal table using multifetch. The values in the internal array are later used at different points of the module multiple times. Now it's the situation that the array holding the DB2 records is overflowing which causes serious issues of leaving behind the vital information behind.

Instant solution is increasing the array size to an X. But this situation may incur again, so is there any design approach that could be handles to prevent this situation anymore.

Thompson,
Can you elaborate me on that? Am a new entrant here to this domain!
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: Thu Feb 12, 2009 10:43 am
Reply with quote

Hello,

Quote:
so is there any design approach that could be handles to prevent this situation anymore.
You might consider using a temporary db2 table or 2 for this process. Instead of loading an in-core array, you would load this process-specific table and use it for the duraton of the process. When the process complets, the temporary table(s) would be dropped.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Load new table with Old unload - DB2 DB2 6
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top