I have a macro that reports the statement number where something bad happened. Some programs that use this are large (although none have yet exceeded 1M lines). This is the logic in the macro that captures that number as efficiently as possible.
Anyway, the technique may be useful in other contexts. .* +--------------------------------------------------------+ .* | | .* | ERRLINE/SYSALVL <2 =2 >2 | .* | <32K LHI LLILL LLILL | .* | <64K LAY LLILL LLILL | .* | <1M LAY LAY LLILF | .* | >=1M L =F L =F LLILF | .* | | .* | LHI, LLILL are 4 bytes, LAY, LLILF are 6, L=F uses 8 | .* | | .* +--------------------------------------------------------+ AIF (&ERRLINE GT 32767 OR &SYSALVL GE 2).TRYLLI LHI R1,&ERRLINE AGO .ERLDONE .TRYLLI AIF (&SYSALVL LT 2).TRYLAY AIF (&ERRLINE GT 65535).TRYLLF LLILL R1,&ERRLINE AGO .ERLDONE .TRYLLF AIF (&SYSALVL LE 2).TRYLAY LLILF R1,&ERRLINE AGO .ERLDONE .TRYLAY AIF (&ERRLINE GT 1048575).LOADERL LAY R1,&ERRLINE AGO .ERLDONE .LOADERL ANOP L R1,=F'&ERRLINE' .ERLDONE ANOP -- sas