C\

 

 

 

 

 

C\ One-time initialization code for this program

 

C\

 

 

 

 

 

C\ Set error code structure to not use exceptions

 

C\

 

 

 

 

 

C

 

EVAL

QUSBPRV = %SIZE(QUSEC)

 

C\

 

 

 

 

 

C\ Check to see if the user space was previously created in￿

 

C\ QTEMP. If it was, simply reuse it.

 

 

C\

 

 

 

 

 

C

 

CALL

'QUSROBJD'

 

 

C

 

PARM

 

RCVVAR

 

C

 

PARM

 

RCVVARSIZ

 

C

 

PARM

'OBJDð1ðð'

ROBJD_FMT

8

C

 

PARM

 

SPC_NAME

 

C

 

PARM

'\USRSPC'

OBJ_TYPE

C

 

PARM

 

QUSEC

 

C\

 

 

 

 

 

C\ Check for errors on QUSROBJD

 

 

C\

 

 

 

 

 

C

QUSBAVL

IFGT

ð

 

 

C\

 

 

 

 

 

C\ If CPF98ð1, then user space was not found

 

 

C\

 

 

 

 

 

C

QUSEI

IFEQ

'CPF98ð1'

 

 

C\

 

 

 

 

 

C\ So create a user space for the list generated by QSYLOBJ￿P

 

C\

 

 

 

 

 

C

 

CALL

'QUSCRTUS'

 

 

C

 

PARM

 

SPC_NAME

 

C

 

PARM

'QSYLOBJP '

EXT_ATTR

C

 

PARM

 

SPC_SIZE

 

C

 

PARM

 

SPC_INIT

 

C

 

PARM

'\ALL'

SPC_AUT

C

 

PARM

\BLANKS

SPC_TEXT

C

 

PARM

'\YES'

SPC_REPLAC

C

 

PARM

 

QUSEC

 

C

 

PARM

'\USER'

SPC_DOMAIN

C\

 

 

 

 

 

C\ Check for errors on QUSCRTUS

 

 

C\

 

 

 

 

 

C

QUSBAVL

IFGT

ð

 

 

C

 

MOVEL

'QUSCRTUS'

APINAM

C

 

EXSR

APIERR

 

 

C

 

END

 

 

 

C\

 

 

 

 

 

C\ Else, an error occurred accessing the user space

 

C\

 

 

 

 

 

C

 

ELSE

 

 

 

C

 

MOVEL

'QUSROBJD'

APINAM

C

 

EXSR

APIERR

 

 

C

 

END

 

 

 

C

 

END

 

 

 

C\

 

 

 

 

 

C\ Set QSYLOBJP (using GETLST) to start a new list

 

C\

 

 

 

 

 

C

 

MOVE

\BLANKS

CONTIN_HDL

 

C

 

EXSR

GETLST

 

 

9-42System API Programming V4R1

Page 248
Image 248
IBM Version 4 Eval Qusbprv = %SIZEQUSEC, Call Qusrobjd Parm Rcvvar Rcvvarsiz, Robjdfmt Parm Spcname \USRSPC Objtype Qusec