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

Monitoring table (Array) growth in COBOL program


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

New User


Joined: 22 Oct 2008
Posts: 49
Location: India

PostPosted: Fri Mar 19, 2010 2:39 am
Reply with quote

Many of my programs are facing overflow issues in table i.e. exceeding the specified array limit. Is there a way to identify the number of trasactions loaded in an array in a particular execution of the program from the log. So that I can monitor the size and increase it, before they actually fail.

I can change my programs to display the index value and monitor the growth but I would want to check if the same can be captured by any other options.
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: Fri Mar 19, 2010 2:45 am
Reply with quote

Hello,

Quote:
from the log
What are you calling "the log"?

Quote:
I can change my programs to display the index value and monitor the growth but I would want to check if the same can be captured by any other options.
Sure, implement code to keep track of usage and at the end of each run put this info in a database table or vsam file. . .
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Mar 19, 2010 2:54 am
Reply with quote

Are you populating the array from a Flat-File or a VSAM-File? I've erroneously suggested in the past that a REXX LISTDSI command would return the number of records on a Flat-File, but that's incorrect. icon_redface.gif

As far as VSAM, you can obtain the number of records associated with a given file via a SHOWCB Macro in a small Assembler sub-program, called from COBOL.

If you do have a Flat-File, you can REPRO it into a temporary (predefined) EDS file and then use the sub-program which invokes the SHOWCB to obtain the number of records.

Once you know the number of records and LRECL of each, you could acquire the correct amount of dynamic-storage, via the LE Callable Service routine "CEEGTST".

With that, your array definition can be placed in LINKAGE, with a true OCCURS DEPENDING ON maximum.

Using this approach, array-spillover will become almost non-existent.

If you can wait until the program (job/step) has completed, the dynamic-storage will be implicitly freed by the operating system.

Otherwise, you can explicitly free this storage via the LE Callable Service routine "CEEFRST".

Bill
Back to top
View user's profile Send private message
smaru

New User


Joined: 22 Oct 2008
Posts: 49
Location: India

PostPosted: Fri Mar 19, 2010 4:41 am
Reply with quote

Bill,
Thanks a lot for the reply. Although I'm not familier with the options you specified, I will learn, try to implement and post my queries.
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Fri Mar 19, 2010 9:46 am
Reply with quote

This sounds like an array is the wrong data structure to be using. A linked list or tree sounds like a better option because you can grow them dynamically. You could also dynamically reallocate the array (I assume - I don't know COBOL) but that would mean that at some point you have 2 copies of the data in storage. More programming, but the situation sounds like it needs it. What happens next month when this month's numbers prove to be too small?
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 Using API Gateway from CICS program CICS 0
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
Search our Forums:

Back to Top