With the default (NOSSRANGE) active, a receiving field using an "out of range" subscript will be overlaid with invalid data (or more precicely, data not intended for that data area). The pgm will continue to execute until it abends because of the subscripting error or abends for another reason or it completes normally.
If you're LUCKY it will abend because of the subscripting error. If it doesn't you may never know, but your user(s) will be acting on erroneous data. Not good!
This is where SSRANGE is helpful. It will abend your pgm whenever the subscript is outside the range of the table it is referencing. E.g. if you have a 10 entry table and the ss is minus, zero or > 10.
Just remember that it has a performance impact and the option s/b changed before the pgm goes into production. Maybe even volume test.
Joined: 31 May 2006 Posts: 200 Location: Netherlands
In other words if you do not have 'SSRANGE' as compiler option, even if you access 11th occurence of an array of size 10. it would still not object but you can not predict the results as mmwife mentioned