Author: Bill Woodger
Subject: Reply to: Protection Exception while move 0 to comp-5 variables
Posted: Tue Oct 18, 2016 7:23 pm (GMT 5.5)
For a data-name used as a subscript, the address referened will be the start of the table plus (the length of the table item multiplied by ( value in data-name mnus one).
If the value in your data-name is zero (for A in your example, and I hope that is not a real name) then the storage you access is outside your table.
If your table is in "acquired" storage (GETMAIN, for instancce) and it is at the beginning of that storage, then whether you get an abend (protection exception) or "just" squish something else in error depends entirely on whether the storage accessed in error is "yours" or not.
Subject: Reply to: Protection Exception while move 0 to comp-5 variables
Posted: Tue Oct 18, 2016 7:23 pm (GMT 5.5)
For a data-name used as a subscript, the address referened will be the start of the table plus (the length of the table item multiplied by ( value in data-name mnus one).
If the value in your data-name is zero (for A in your example, and I hope that is not a real name) then the storage you access is outside your table.
If your table is in "acquired" storage (GETMAIN, for instancce) and it is at the beginning of that storage, then whether you get an abend (protection exception) or "just" squish something else in error depends entirely on whether the storage accessed in error is "yours" or not.