ONSUBSCRIPT

ONSUBSCRIPT returns a REAL FIXED BIN(63) value that specifies the invalid array index which caused SUBSCRIPTRANGE to be raised.

Read syntax diagramSkip visual syntax diagramONSUBSCRIPT()

If ONSUBSCRIPT is used out of context, zero is returned.

If the following code is run, then ONSUBSCRIPT would return 5.
          dcl a(3,2:4) fixed bin(31) init( (*) 0 );
          dcl jx       fixed bin(31);
          dcl value    fixed bin(31);

          jx = 5;
          (subrg): value = a(1,jx);