Hi,
A job was abended in production. The reason was that COBOL internal table was overlowed. We are not using SSRANGE in production. It is told it is standard. In my last compnay also we were not using SSRANGE in production. Why it is not allowed, what is wrong with this option?
Why SSRANGE is not allowed?
- Robert Sample
- Global Moderator
- Posts: 1900
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Why SSRANGE is not allowed?
With SSRANGE, the compiler adds code to check table limits -- which potentially means a LOT of code could be added. The V5.1 Performance Tuning Guide manual states on page 25:
So many sites prohibit SSRANGE in production code due to the performance hit suffered. There is nothing "wrong" with the option -- it does what it is designed to do. The issue is the performance impact of the option.A benchmark that makes moderate use of subscripted references to tables slows down by 20% when SSRANGE is specified.
- Robert Sample
- Global Moderator
- Posts: 1900
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Why SSRANGE is not allowed?
Nobody ever wants to hear this, but the best way to avoid such abends is to write better code. Have the table size (number of elements) stored in a variable and EVERY time a subscript is set, test to make sure it is within the table limit. This can be tedious and if the code does not already have this in it, there can be a major effort required to add the tests. But since there is nothing in COBOL except SSRANGE to do such testing, this is what has to be done to prevent abends from table overflows.So what is the best way to avoid such abends in production?
- Anuj Dhawan
- Founder
- Posts: 2816
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Why SSRANGE is not allowed?
This had been a standard at couple of shops I had been to but if a shop has never adopted for this, it can indeed be tedious.Robert Sample wrote: ↑Fri Oct 26, 2018 5:30 pmHave the table size (number of elements) stored in a variable and EVERY time a subscript is set, test to make sure it is within the table limit.
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute