C Z-ADD31 LENSTR
C\
C EXSR EXCCMD
C\
C\ Delete the library
C\
C MOVELDLTLIB CMDSTR
C Z-ADD2ð LENSTR
C\
C EXSR EXCCMD
C\
C SETON LR
C RETRN
C\
C\ End of MAINLINE
C\
C\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
C\
C EXCCMD BEGSR
C\
C\ Process requested CL command
C\
C CALL 'QCAPCMD'
C PARM CMDSTR
C PARM LENSTR
C PARM QCABC
C PARM SIZE
C PARM 'CPOPð1ðð'FORMAT 8
C PARM RCVVAR 1
C PARM ð RCVSIZ
C PARM RCVSIZ
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 MOVEL'QCAPCMD' APINAM
C EXSR ERRCOD
C ENDIF
C ENDSR
C\
C\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
C\
C ERRCOD BEGSR
C\
C\ Process errors returned from the API.
C\
C\ If first error found, then open QPRINT \PRTF
C\
C FSTERR IFEQ 'ð'
C OPEN QPRINT
C MOVEL'1' FSTERR
C ENDIF
C\
C\ Print the error and the API that received the error
Appendix B. Original Examples in Additional Languages B-171