C\

 

 

 

 

 

C\ Get a resolved pointer to the user space for performance￿

 

C\

 

 

 

 

 

C

 

CALL

'QUSPTRUS'

 

 

C

 

PARM

 

SPC_NAME

 

C

 

PARM

 

SPCPTR

 

C

 

PARM

 

QUSEC

 

C\

 

 

 

 

 

C\ Check for errors on QUSPTRUS

 

 

C\

 

 

 

 

 

C

QUSBAVL

IFGT

ð

 

 

C

 

MOVEL

'QUSPTRUS'

APINAM

C

 

EXSR

APIERR

 

 

C

 

END

 

 

 

C

 

ENDSR

 

 

 

C\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

C

APIERR

BEGSR

 

 

 

C\

 

 

 

 

 

C\ Log any error encountered, and exit the program

 

C\

 

 

 

 

 

C

APINAM

DSPLY

 

QUSEI

 

C

 

EXSR

DONE

 

 

C

 

ENDSR

 

 

 

C\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

C

DONE

BEGSR

 

 

 

C\

 

 

 

 

 

C\ Exit the program

 

 

 

 

C\

 

 

 

 

 

C

 

EVAL

\INLR = '1'

 

 

C

 

RETURN

 

 

 

C

 

ENDSR

 

 

 

Coding for New Function—Example

of

Correct

Coding

 

 

 

 

 

 

 

 

 

In the following example program,

code

has

been

written

that

checks

types *SRVPGM, *PGM, and *SQLPKG. If

an

object

type

is encountered that

unknown

(it

does

not match

*SRVPGM,

*PGM, or

*SQLPKG),

an

error

is

logged

and

an

exit

from the

program takes

place.

 

 

 

 

 

The

coding

to

handle

the

integration of new function (in this case

type

 

that

can

adopt

owner

authority).23/ ison

shownpage at9-47.

 

 

C\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

 

 

C\

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C\Program Name: PGM2

 

 

 

 

 

 

 

 

 

 

 

C\

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C\Program Language:

ILE RPG

 

 

 

 

 

 

 

 

 

 

C\

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C\Description: This example program demonstrates how a pr￿ogram can

 

 

C\

 

 

be coded to accept new functions introduced on the AS/4ðð.

 

C\

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C\

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C\

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C\Header Files Included: QUSGEN -

Generic Header of a User Space

 

 

D\

 

 

 

 

 

 

(Copied Into Program)

 

 

 

 

C\

 

 

 

 

QUSEC -

Error Code Parameter

 

 

 

 

D\

 

 

 

 

 

 

(Copied Into Program)

 

 

 

 

C\

 

 

 

 

QSYLOBJP - List Objects API

 

 

 

 

 

 

 

 

 

 

 

 

 

Chapter

9.

Common

API

Programming

Errors 9-43

 

Page 249
Image 249
IBM Version 4 manual Coding for New Function-Example Correct, Does Not match, PGM, or