C MOVE '1' REC,OF
C EXSR CALCVO
C Z-ADD3 QUSBCC
C Z-ADD4 QUSBCD
C Z-ADD37 BINARY
C 12 ADD VO OF
C MOVEABINC REC,OF
C EXSR CALCVO
C\
C\ Call the API to add the exit program.
C\
C CALL 'QUSADDEP'
C PARM EPNTNM
C PARM 'EXMPð1ðð'FORMAT
C PARM 1 BINARY
C PARM EPGM
C PARM EPGMDT
C PARM EPGMSZ
C PARM VARREC
C PARM QUSBN
C\
C\ If an exception occurs, the API returns the exception in the
C\ error code parameter. The bytes available field is set to
C\ zero if no exception occurs and greater than zero if an
C\ exception does occur.
C\
C QUSBNC IFGT ð
C OPEN QPRINT
C EXCPTERRPGM
C EXSR DONE
C ENDIF
C EXSR DONE
C\
C\ End of MAINLINE
C\
C\
C\ Return to programs caller
C DONE BEGSR
C SETON LR
C RETRN
C ENDSR
C\
C\ Calculate 4-byte aligned offset for next variable length record
C\
C CALCVO BEGSR
C QUSBCD ADD 12 BINARY
C DIV 4 BINARY
C MVR BINARY
C BINARY IFEQ ð
C QUSBCD ADD 12 QUSBCB
C ELSE
C 4 SUB BINARY QUSBCB
C ADD QUSBCD QUSBCB
C ADD 12 QUSBCB
C END
C MOVEAQUSBC REC,VO
C ADD QUSBCB VO
C ENDSR
Appendix B. Original Examples in Additional Languages B-57