MOVE "OBJPð2ðð" TO MBR-LIST.

\

CALL "QSYLOBJP" USING SPC-NAME, MBR-LIST, USR-PRF, OBJ-TYPE, CONTIN-HDL, QUS-EC. .3/

\

\Check for errors on QSYLOBJP

IF BYTES-AVAILABLE OF QUS-EC > ð

MOVE "QSYLOBJP" TO APINAM, PERFORM APIERR.

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

INIT.

\

\One time initialization code for this program

\Open LISTING file

\

OPEN OUTPUT LISTING.

\

\Set Error Code structure to not use exceptions

MOVE LENGTH OF QUS-EC TO BYTES-PROVIDED OF QUS-EC.

\Check to see if the User Space was previously created in

\QTEMP. If it was, simply reuse it.

\

CALL "QUSROBJD" USING RCVVAR, RCVVARSIZ, ROBJD-FMT, SPC-NAME, SPC-TYPE, QUS-EC.

\

\Check for errors on QUSROBJD

IF BYTES-AVAILABLE OF QUS-EC > ð

\If CPF98ð1, then User Space was not found

IF EXCEPTION-ID OF QUS-EC = "CPF98ð1"

\So create a User Space for the List generated by QSYLOBJP￿

CALL "QUSCRTUS" USING SPC-NAME, EXT-ATTR, SPC-SIZE, SPC-INIT, SPC-AUT, SPC-TEXT,

SPC-REPLAC, QUS-EC, SPC-DOMAIN

\

\Check for errors on QUSCRTUS

IF BYTES-AVAILABLE OF QUS-EC > ð

MOVE "QUSCRTUS" TO APINAM, PERFORM APIERR,

ELSE CONTINUE,

ELSE

\

\Else, an error occurred accessing the User Space

MOVE "QUSROBJD" TO APINAM, PERFORM APIERR.

\Set QSYLOBJP (via GETLST) to start a new list

Appendix B. Original Examples in Additional BLanguages-105

Page 383
Image 383
IBM Version 4 manual Move Qsylobjp to APINAM, Perform Apierr, Move Length of QUS-EC to BYTES-PROVIDED of QUS-EC