Joined: 06 Jun 2008 Posts: 8564 Location: Dubuque, Iowa, USA
Questioning why no S0C4, S0C7 is not happening, and how this is working at all.
Why would it not work?
COBOL tables, unless the compiler option SSRANGE is used, can use whatever subscript they want -- and as long as the subscript remains in the range of the table there is no issue. What the code does is define a table that overlays the first two lines of ZIO-LGTH-FILE-TABLE. The other 90-odd lines of ZIO-LGTH-FILE-TABLE are still in memory and available so a subscript of 93, for example, is still within the memory locations of ZIO-LGTH-FILE-TABLE and hence will return the appropriate values. If the code used 5093 as a subscript, then you'd likely get a S0C7 or S0C4 error, but not for 94 or less.
The whole point of compiler option SSRANGE is to check indexes and subscripts against the size of the table at runtime. If the code is not compiled with SSRANGE, then there is no check on whether a particular subscript is within the table limits or not and hence the code displayed will work perfectly fine.