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
 
Monitoring table (Array) growth in COBOL program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Monitoring table (Array) growth in COBOL program
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

Site Director


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

PostPosted: Fri Mar 19, 2010 2:45 am    Post subject:
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: 2504
Location: Atlanta, Georgia, USA

PostPosted: Fri Mar 19, 2010 2:54 am    Post subject: Reply to: Monitoring table (Array) growth in COBOL program
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    Post subject: Reply to: Monitoring table (Array) growth in COBOL program
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: 401
Location: Mumbai

PostPosted: Fri Mar 19, 2010 9:46 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts Calling IKJEFT01 program from Rexx upendrasri CLIST & REXX 8 Wed Nov 15, 2017 4:27 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am

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