I 31 6ð OBJ1L
I 61 7ð OBJ1T
C\
C\ Prepare for divide-by-zero situation
C\
C Z-ADD1ð FACT1
C Z-ADDð FACT2
C\
C\ and divide by ð
C\
C FACT1 DIV FACT2 RESULT
C\
C\ should not get here due to divide-by-ð exception
C\
C MOVE '1' \INLR
C RETRN
C\
C\ Program exception subroutine:
C\
C \PSSR BEGSR
C\
C\ Make sure we are not catching an exception due to the \PSSR
C\ subroutine itself
C\
C SWITCH IFEQ ' '
C MOVE '1' SWITCH 1
C\
C\ Set API error code to work in nonexception mode
C\
C Z-ADD16 QUSBNB
C\
C\ Record the source listing line number that caused the failure
C\
C\ First, extract the numeric portion of the PSDS line number
C\
C Z-ADD8 X
C Z-ADD8 Y
C Z-ADDð LIN#C
C SRC,X DOWEQ' '
C SUB 1 X
C END
C X DOWGTð
C MOVE SRC,X TGT,Y
C SUB 1 X
C SUB 1 Y
C END
C\
C\ Then record it:
C\
C Z-ADDLIN#C FAILPT
C\
C\ Record the status code for the failure
C\
C MOVELSTATUS DATA
C\
C\ Record where to find the status data within DATA
C\
C Z-ADDð DTAOFF
B-118 System API Programming V4R1