IBM Version 4 manual Dow, Exsr Cusrei Enddo Endif Done, Cusrei Begsr

Models: Version 4

1 505
Download 505 pages 30.92 Kb
Page 362
Image 362

C

 

DOW

QUSCHðð <> \BLANKS

 

C

 

EVAL

CONTIN_HDL = QUSCHðð

 

C

 

EXSR

CUSREI

 

 

C

 

ENDDO

 

 

 

C

 

ENDIF

 

 

 

C

 

ENDIF

 

 

 

C

 

EXSR

DONE

 

 

C\

 

 

 

 

 

C\ End of MAINLINE

 

 

 

 

C\

 

 

 

 

 

C\ Process exit programs in receiver variable

 

C\

 

 

 

 

 

C

CUSREI

BEGSR

 

 

 

C\

 

 

 

 

 

C\ Call the API to retrieve the exit program information

 

C\

 

 

 

 

 

C

 

CALLB

QUSREI

 

 

C

 

PARM

 

CONTIN_HDL

 

C

 

PARM

 

RCVVAR

 

C

 

PARM

 

RCVVAR_SZ

 

C

 

PARM

'EXTIð2ðð'

FORMAT

8

C

 

PARM

 

EPNTNAME

 

C

 

PARM

'EXMPð1ðð'

EPNT_FMT

8

C

 

PARM

 

EPGM_NBR

 

C

 

PARM

ð

QUSNBRSC

 

C

 

PARM

 

QUSEC

 

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

IF

QUSBAVL > ð

C

OPEN

QPRINT

C

EXCEPT

ERRAEPGM

C

EXSR

DONE

C

ENDIF

 

C\

 

 

C\ If the call to retrieve exit program information is succ￿essful,

C\ check to see if there are any exit programs to call.

C\

C\ The receiver variable offers enough room for a minimum o￿f one

C\ exit program entry because the receiver variable was de￿clared

C\ as 35ðð bytes. Therefore, this example only checks the

C\ number of exit programs returned field. If the receiver

C\ variable were not large enough to hold at least one entr￿y,

C\ the bytes available field would need to be checked as we￿ll as

C\ the number of exit programs returned field. If the number of

C\ exit programs returned field is set to zero and the byte￿s

C\ available field is greater than the bytes returned fiel￿d, the

C\ API had at least one exit program entry to return but was￿

C\ unable to because the receiver variable was too small.

C\

 

 

C

EVAL

INFSPCPTR = %ADDR(RCVVAR(QUSOPGME+1))

C

DO

QUSNBRPRðð

C\

 

 

C\ Get the exit program name and library

C\

B-84System API Programming V4R1

Page 362
Image 362
IBM Version 4 manual Dow, Exsr Cusrei Enddo Endif Done, Cusrei Begsr