Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

COBOL 5.1 and the UNBOUNDED Keyword

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

CICS Moderator


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

PostPosted: Tue Apr 29, 2014 7:31 pm    Post subject: COBOL 5.1 and the UNBOUNDED Keyword
Reply with quote

In a current program, here's what we do -

Code:

 01  QUEUE-DEFINITION-TABLE.                                     
     05  QUEUE-DEF-MAX       PIC  S9(08) COMP-5.                                               
     05  QUEUE-DEF-TBL       OCCURS 1 TO 10000 TIMES   

This array loads a VSAM file, with the number of records obtained from an Assembler sub-program, which issues a SHOWCB Macro. The current 10000 seems to be a good threshold.

We dynamically calculate the max number of records in this array, by dividing THE LENGTH OF QUEUE-DEFINITION-TABLE (minus THE LENGTH OF QUEUE-DEF-MAX) by THE LENGTH OF QUEUE-DEF-TBL (1). If the number of records returned from the sub-program is greater than the calculated-max, then we have a problem.

Now, in COBOL 5.1, we have the UNBOUNDED keyword, which substitutes for the hard-coded max of 10000.

But when UNBOUNDED is used THE LENGTH OF QUEUE-DEFINITION-TABLE in the compiler doesn't have a length, but rather a "0CL*", which basically says "I don't know the length because you're using UNBOUNDED".

I was told (by Tom Ross) that UNBOUNDED has a max based upon the picture clause and definition, which in this case is a signed binary-fword.

So, if I wanted to define THE LENGTH OF QUEUE-DEFINITION-TABLE, I'd use X'7FFFFFFF' which is the max value for a binary-fword.

I'd like to get some feedback on this approach. Otherwise, I'll leave it at 10000 and that will be that.

Regards,
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7308

PostPosted: Tue Apr 29, 2014 8:08 pm    Post subject: Reply to: COBOL 5.1 and the UNBOUNDED Keyword
Reply with quote

The maximum value your ODO item can hold would be the maximum number of entries in the table.

Depending on the maxima for LINKAGE SECTION items for V5.1, which I haven't checked, that would be it.

However, it would require that the ASM program is returning a value in a field which is longer/contains a higher maximum value (ie unsigned) than the ODO item, else your test for over-the-top will never be true, and other stuff within the table will probably get overwritten, or something outside the table will.

On the other hand, if the figure from the ASM can never big bigger than the maximum of the ODO, you don't even need to test it...
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Tue Apr 29, 2014 9:54 pm    Post subject: Reply to: COBOL 5.1 and the UNBOUNDED Keyword
Reply with quote

I've decided to leave it at 10000 as it would cause changes to the program that (for the most part) seem unnecessary. Besides, the new method incorporated into 5.1, to calculate BLL's at approximately a 512K chunk allocation has certainly sped up large table addressability.

All and all, 5.1 looks like the compiler folks did a good job....
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 RULES(NOEVENPACK) in cobol jackzhang75 COBOL Programming 5 Wed Mar 29, 2017 12:47 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us