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 RP￿G

 

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 p￿arameter

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 f￿irst

C\ 16 bytes of the error code structure are available. If the

 

C\ application program needed to access the variable leng￿th

 

C\ exception data for the error, the developer should physi￿cally

C\ copy the QSYSINC

include and modify the copied include t￿o

 

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

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 BLanguages-33

Page 311
Image 311
IBM Version 4 Using Keys with List, Exsr Error Else, Qwdoill ADD Qwdnlill Eval, Call Qcmdexc Parm Cmdstring Lenstr ADD