IBM Version 4 Universal Remote User Manual


 
C IF QUSBAVL > 
C
Cᑍ If there was an error, exit to ERROR subroutine
C
C EXSR ERROR
C ELSE
C
Cᑍ Else, add 1 to the Initial library list offset because RPG
Cᑍ is a Base 1 language
C
C QWDOILL ADD 1 X 5 
C DO QWDNLILL
C EVAL LIBRARY = %SUBST(QWDD1:X:1)
C
Cᑍ Let's tell everyone what the library value is
C
C CALL 'QCMDEXC'
C PARM CMD_STRING
C PARM LENSTR
C ADD 11 X
C IF (X + 1) > RCVLEN
C LEAVE
C ENDIF
C ENDDO
C ENDIF
C
C EVAL ᑍINLR = '1'
C RETURN
C
Cᑍ End of MAINLINE
C
Cᑍ Subroutine to handle errors returned in the error code parameter
C
C ERROR BEGSR
C
Cᑍ Process errors returned from the API. As this sample program
Cᑍ used /COPY to include the error code structure, only the first
Cᑍ 16 bytes of the error code structure are available. If the
Cᑍ application program needed to access the variable length
Cᑍ exception data for the error, the developer should physically
Cᑍ copy the QSYSINC include and modify the copied include to
Cᑍ define additional storage for the exception data.
C
C ENDSR
Using Keys with List Spooled Files API—ILE C Example
Refer to “Using Keys with List Spooled Files API—Example” on page 3-24 for the
original example.
/ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ/
/ᑍ ᑍ/
/ᑍ Program: List Spooled Files for Current User ᑍ/
/ᑍ ᑍ/
/ᑍ Language: ILE C ᑍ/
/ᑍ ᑍ/
/ᑍ Description: This example shows the steps necessary to ᑍ/
/ᑍ process keyed output from an API ᑍ/
Appendix B. Original Examples in Additional Languages B-33