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
 
Mamixum number of occurrence of an array

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

New User


Joined: 27 Nov 2008
Posts: 51
Location: Delhi, India

PostPosted: Tue Nov 17, 2009 12:24 pm    Post subject: Mamixum number of occurrence of an array
Reply with quote

May I know, what is the maximum number of occurrence of an array that we can define in a COBOL program?
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: Tue Nov 17, 2009 12:26 pm    Post subject:
Reply with quote

It depends on the length of each occurrence. The answer is in the Language Reference manual. See Appendix B - Compiler limits.
Back to top
View user's profile Send private message
ppandey07

New User


Joined: 27 Nov 2008
Posts: 51
Location: Delhi, India

PostPosted: Tue Nov 17, 2009 12:48 pm    Post subject:
Reply with quote

Terry Heinze wrote:
It depends on the length of each occurrence. The answer is in the Language Reference manual. See Appendix B - Compiler limits.



Thanks Terry for the prompt reply.
Each occurrence is of 62 bytes and the file that I have to load into this array has around more then half million records. So I am getting compilation error for that. Would ODO work over here?
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Tue Nov 17, 2009 1:18 pm    Post subject:
Reply with quote

Hi Pandey,

Assuming your table size as half million records, I guess your table size is exceeding the max limit.

Am referring this link for calculation...
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: Tue Nov 17, 2009 8:38 pm    Post subject:
Reply with quote

Hello,

Quote:
Would ODO work over here?
ODO is to "limit" the processing in an array not make it larger. When an ODO is specified, the full amount of memory has to be allocated regardless.

Again, complete info is in the Labguage Reference manual (previously linked by Binop B or available via the "IBM Manuals" link at the top of the page).
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: Tue Nov 17, 2009 8:51 pm    Post subject: Reply to: Mamixum number of occurrence of an array
Reply with quote

A "True" ODO is when the array is defined to LINKAGE and dynamic-storage is allocated, based upon the number of records in the file.

For COBOLer's, LE Callable Service routine "CEEGTST" can be used to acquire dynamic-storage.

Bill
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: Tue Nov 17, 2009 8:51 pm    Post subject:
Reply with quote

Binop's link is for older releases of COBOL. Enterprise COBOL has a much higher limit, so check which compiler you're using.
Back to top
View user's profile Send private message
jctgf
Currently Banned

Active User


Joined: 04 Nov 2006
Posts: 109

PostPosted: Wed Nov 18, 2009 4:48 am    Post subject:
Reply with quote

By talking in ODO, I have a question, please.

What would be the advantage in using it considering that the amount of memory allocated is the same that in a non-ODO array?

Is there any performance gain?

Thanks.
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 Nov 18, 2009 5:07 am    Post subject:
Reply with quote

OCCURS DEPENDING ON tells a serial SEARCH when to stop searching and a binary SEARCH ALL where to start searching. Please read about ODO in the Language Reference manual.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Wed Nov 18, 2009 5:07 am    Post subject:
Reply with quote

search the forum for ODO.
It has been discussed many times and the reasons have been rather expansive.

if you are too lazy to search the forum, look at the application programmers guide for cobol - button at top - manuals.
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: Wed Nov 18, 2009 5:43 am    Post subject: Reply to: Mamixum number of occurrence of an array
Reply with quote

Here's a recent posting regarding Dynamic arrays and their benefits -

http://www.ibmmainframes.com/viewtopic.php?p=209663&highlight=#209663

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

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Nov 18, 2009 6:31 pm    Post subject:
Reply with quote

There's good reasons to use ODO, such as tables where you don't know how big they are until run time, and variable length files but saving memory is not one of the reasons.

Reasons, apart from what others has pointed to, would include using SSRANGE to prevent going past the defined boundary, copying a variable file to working storage (if the file has occurs depending on, it's easiest to just code the structures the same), and replicate a structure being passed from another language (C for example) which does allow variable length data.
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 Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm
No new posts Profile changed to NUMBER ON STD (fro... Martylin TSO/ISPF 1 Thu Aug 03, 2017 9:14 am
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm

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