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 1
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 for object
types *SRVPGM, *PGM, and *SQLPKG. If an object type is encountered that is
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 the new object
type that can adopt owner authority) is shown at 23 on page 9-47.
Cᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
Cᑍ
CᑍProgram Name: PGM2
Cᑍ
CᑍProgram Language: ILE RPG
Cᑍ
CᑍDescription: This example program demonstrates how a program 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