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 5
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 'EXMP1'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