HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

COBOL RESERVE CLAUSE QUESTION

 
SOLVED
Go to solution
Homer Shoemaker
Frequent Advisor

COBOL RESERVE CLAUSE QUESTION

I'm in the process of cloning an I/O subroutine for a new file I'm creating. Every once in a while I try to understand a little more of what I'm cloning. In this case, the RESERVE clause.

FILE-CONTROL.

SELECT OPTIONAL INVBRK
ASSIGN TO INVBRK
RESERVE 4 AREAS
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS INVBRK-KEY
FILE STATUS IS FILE-STAT.

I-O-CONTROL.
APPLY
EXTENSION 50
CONTIGUOUS-BEST-TRY PREALLOCATION 100
ON INVBRK.

What I think I know:
I'm creating buffers (using RAM)for RMS to store and manipulate data that was pulled off the disk so that RMS can access records that might have been in the last disk read without requiring another disk read.

What I haven't figured out:
1) What's an AREA?
2) And how do I know I need 4 of them?
3) Does the system not use any 'AREAs' when the RMS defaults are as in the attachment?


note: I hope the attachment made it.
6 REPLIES
Garry Fruth
Trusted Contributor

Re: COBOL RESERVE CLAUSE QUESTION

I'd have to check the cobol reference manual to see if this has changed over the last few years. As I recall, an 'AREA' is an RMS buffer. I assume, based on your attachment of a SHOW RMS command output, that you are familiar with RMS buffers.

For an indexed file, if you are doing keyed reads or reading sequentially on an alternate key, then in my opinion four is not enough. Perhaps 127.
Homer Shoemaker
Frequent Advisor

Re: COBOL RESERVE CLAUSE QUESTION

Garry,

Thanks for the response. I'll use the larger number for the new file.

This raises another issue for me. As I stated, I'm cloning a standard I/O sub-program that we use alot. This is a 'mature', i.e. 'old' application and the most used files are ALL accessed by sub-programs which reserve only 3, 4, or 5 AREAS. (Some of these were written back when 16K of RAM came on a circuit board the size of my desktop and cost as much as a small car. Maybe that's why the original programmer used such a small number.)

And we do have Direct I/O based performance issues during periods of heavy use. Now I'm thinking that I could improve performance by changing some of these sub-programs.

Does this make sense to you? And if so, what criteria did you use to come up with the number 127?

Hein van den Heuvel
Honored Contributor
Solution

Re: COBOL RESERVE CLAUSE QUESTION

>> RESERVE 4 AREAS

BAD... in general.

>> EXTENSION 50
>> CONTIGUOUS-BEST-TRY PREALLOCATION 100

BAD... in general.

>> I'm creating buffers (using RAM)for RMS to store and manipulate data that was pulled off the disk so that RMS can access records that might have been in the last disk read without requiring another disk read.

Close enoug. You are telling RMS to use just 4 IO buffers no matter how many it really needs. Those buffers will hold BUCKETS which might hols RECORDS or INDEX information.

>> What I haven't figured out:
>> 1) What's an AREA?

In COBOL terms it is an *LOCAL* RMS file buffer.

In RMS terms, confusingly, it is pool of equal sized buckets to make allocations from.

2) And how do I know I need 4 of them?

You don't. It depends.

You probably need just 2, IF AND ONLY IF, the file also uses GLOBAL BUFFERS

Rule of thumb
1) simple sequential access by primary key: 2
2) single keyed lookup: 1

3) repeated key lookups : as many as the used index is deep + 1. This is the RMS default. It may well be more than 4

4) Inserting 1 record? 2

4) Repeatedly inserting record?
The deepest index time the number of indexed + 50%.

Come to my BOOT CAMP sessions, or find an old presenation, and learn all about it!

>> 3) Does the system not use any 'AREAs' when the RMS defaults are as in the attachment?

No, on the contrary. The AREA clause will over-rule the default. Which is great IF you know exactly what you are doing.

WHEN IN DOUBT, LEAVE IT OUT!

Garry>> For an indexed file, if you are doing keyed reads or reading sequentially on an alternate key, then in my opinion four is not enough.

Correct!

>> Perhaps 127.

Probably not. better give that kind of memory to GLOBAL buffers where all concurrent users can benefit.
RMS does serial cache searches for local buffers (hashed for global) which may sloow down beyond 50 or so.
Try 20 or 40 first.

>> This is a 'mature', i.e. 'old' application and the most used files are ALL accessed by sub-programs which reserve only 3, 4, or 5 AREAS.

That NEVER was a good idea.
It suggest teh developpers where thinking in the right direction, but not thinking far enough ahead.

A LITTLE KNOWLEDGE IS A DANGEROUS THING.

>>> And we do have Direct I/O based performance issues during periods of heavy use. Now I'm thinking that I could improve performance by changing some of these sub-programs.

Sure sounds like it!

Sounds like the customer could benefit froma comprehensive performance review. Several participants in this forum, including myself, will be happy to provide that... for fee.

>>> And if so, what criteria did you use to come up with the number 127?

It's the max for certain ways to set it.
It is likely to help well, but might not help better than say 20.
It MAY even be worse than 4 in unlikely, low CPU power, cases.

Hope this helps some,
Hein van den Heuvel (at gmail dot com)
HvdH Performance Consulting
Homer Shoemaker
Frequent Advisor

Re: COBOL RESERVE CLAUSE QUESTION

"BAD... in general."

Thanks. I'll do some more reading.

These buffers hold RMS buckets which hold records or index information. Got it. Thanks.

"In COBOL terms it is a *LOCAL* RMS file buffer. In RMS terms, confusingly, it is pool of equal sized buckets to make allocations from."

Aha!

"Come to my BOOT CAMP sessions, or find an old presenation, and learn all about it!"

If you're talking about Nashua, I already have my request in to management. My fingers are crossed. And I'll be looking for the old presentation right after I post this.

If afterwards, I still have questions (which I do at this point) about:

1) how to determine whether a file is using GLOBAL BUFFERS
2) what exactly you mean by how deep an index is
3) what (hashed for global) means

then I may be back. In the mean time, THANK YOU BOTH, VERY MUCH.


Note to self:
WHEN IN DOUBT, LEAVE IT OUT!
A LITTLE KNOWLEDGE IS A DANGEROUS THING.

:o)



Hein van den Heuvel
Honored Contributor

Re: COBOL RESERVE CLAUSE QUESTION

I see that my 'SHOUTED' comments at least made you smile. Excellent.

I did presenations on HP Tech Forums and bootcaps and such. Most of those are in a 'attendees' only areas.

There is a relatively comprehensive version online here:
http://gerritwoertman.eu/NL-VMSTUD2006/NL-VMSTUD-2006-ppt/2006_RMS_Utrecht_Dutchworld.ppt

There is an older, shorter, version on your OpenVMS freeware CD's in [RMS_tools]

http://h71000.www7.hp.com/freeware/freeware60/rms_tools/rms_tuning.ppt

Enjoy!
Hein.


Homer Shoemaker
Frequent Advisor

Re: COBOL RESERVE CLAUSE QUESTION

Thanks! This is plenty to digest. I'll open another thread if I have more questions.