PL/I · Exception

ONCODE 520: SUBSCRIPTRANGE

What does ONCODE 520: SUBSCRIPTRANGE mean in PL/I?

A program-checkout condition: an array subscript was evaluated to a value outside the bounds declared for that dimension.

ONCODE 520: SUBSCRIPTRANGEIBM Enterprise PL/I for z/OS · PL/I for AIX

Condition

A program-checkout condition: an array subscript was evaluated to a value outside the bounds declared for that dimension.

Fix

Check loop bounds and any subscript computed from input data against the array's actual declared bounds. IBM has documented cases where a SUBSCRIPTRANGE condition raised by code originally compiled under PL/I for MVS & VM is not caught by an ON SUBSCRIPTRANGE unit after being recompiled under Enterprise PL/I, so if the condition is not being trapped as expected after a compiler upgrade, check for this specific migration gap rather than assuming the ON-unit itself is wrong.

Related exception