Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
COBOL batch program using large size array

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Akriti Mishra

New User


Joined: 26 Mar 2020
Posts: 1
Location: India

PostPosted: Thu Mar 26, 2020 11:37 pm    Post subject: COBOL batch program using large size array
Reply with quote

I have a COBOL batch program using large size array/table in it. What can be the alternatives to this array? The array size is going to increase in future? Or what can be an intelligent way to interact with tha day inside this array?
Back to top
View user's profile Send private message

Jose Mateo

Active User


Joined: 29 Oct 2010
Posts: 117
Location: Puerto Rico

PostPosted: Fri Mar 27, 2020 12:55 am    Post subject:
Reply with quote

I had a similar problem where this program was reading a file and building an internal table with active accounts. The problem is that the input file was growing quickly and so often we had to increase the internal COBOL table. I agree this was a poor system design from the programmer who wrote the COBOL program. I resolved this issue by defining a external KSDS VSAM file and in the program I would read the input file and write the active accounts to the VSAM file. Once the input file reached EOF I would close the VSAM file and open it as input. Then I would search the VSAM file randomly by social security.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8526
Location: Dubuque, Iowa, USA

PostPosted: Fri Mar 27, 2020 1:28 am    Post subject: Reply to: COBOL batch program using large size array
Reply with quote

Which version of Enterprise COBOL are you using? And what is a
Quote:
large size array/table
anyway? Current COBOL supports either 999,999,999 bytes for a single data item (if 32 bit) or 2,147,483,646 bytes (if 64 bit) so unless your large array/table is approaching these limits, you won't need to worry for a while.

The classic method, if you run out of memory for your data, is to write it to disk and VSAM works well for this as pointed out elsewhere.
Back to top
View user's profile Send private message
Apoorva

New User


Joined: 28 Jan 2020
Posts: 21
Location: India

PostPosted: Fri Mar 27, 2020 12:16 pm    Post subject: Re: COBOL batch program using large size array
Reply with quote

Akriti Mishra wrote:
I have a COBOL batch program using large size array/table in it. What can be the alternatives to this array? The array size is going to increase in future? Or what can be an intelligent way to interact with tha day inside this array?


As an alternative you could use a VSAM file to store the table data. With VSAM, you could store 4GB worth of data, and if the VSAM has "extended addressability" then it could go beyond 4GB. Though you get more space to store your data with VSAM, the tradeoff is processing time. Accessing VSAM involves I/Os, and hence will be slower than accessing data from the table.

If you want to deal with growing table size using internal tables itself, you could probably try using "linked lists" for tables. You could set aside 1st 4 bytes of your table to hold the pointer to the next table. As you load data to your table, and if the table can't hold anymore data, you could do a "GETMAIN" to allocate a new table, and store the new table address in the pointer of the 1st table (1st 4 bytes at the start of table). You can repeat this process until you are done loading the data. Finally if you have "n" tables built, 1st table will point to 2nd, 2nd will point to 3rd, .......... (n-1)th table points to nth table, and the pointer in the nth table will have just zeros which is an indication that it's the last table.
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 Trying to submit COBOL PGM - JCL ERRO... sandeep prajapati JCL & VSAM 5 Tue Mar 24, 2020 11:21 pm
No new posts How to create UUID using COBOL PORYES COBOL Programming 0 Tue Mar 17, 2020 4:43 pm
No new posts Navigation program in CICS Ziko13 CICS 11 Fri Mar 06, 2020 2:30 pm
This topic is locked: you cannot edit posts or make replies. Cobol db2 program going in loop sivasaras COBOL Programming 4 Sat Feb 29, 2020 7:44 pm
No new posts Cobol redefines for Signed pictured c... gvvjags COBOL Programming 4 Thu Feb 27, 2020 4:33 pm

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