Processing a List
This is the preferred method for processing lists. To correctly process through a
list, do the following:
1. Use the offset to list data section field (see .5/ on page 5-9)
2. Look at the number of list entries field in the list (see .6/ on page 5-10)
3. Add the size of each entry field to get to the start of the next entry (see .7/ on
page 5-9)
IBM may add fields to the bottom of formats in future releases. If this occurs and
your code uses the size of each entry for a previous release, your list would not
process at the start of each entry.
The example program defines the size of each entry at .4/ on page 5-9. For
another example that shows the correct and incorrect way, see “Defining List Entry
Format Lengths” on page 9-14.
List Object API—OPM RPG Example
The example program prints a report that shows all objects that adopt owner
authority.
F\
F\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
F\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
F\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
F\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
F\
F\Program Name: List objects which adopt owner authority
F\
F\Language: OPM RPG
F\
F\Description: This program prints a report showing all objects
F\ that adopt owner authority. The two parameters
F\ passed to the program are the profile to be
F\ checked and the type of objects to be listed.
F\ The parameter values are the same as those
F\ accepted by the QSYLOBJP API.
F\
F\APIs Used: QSYLOBJP - List Objects that Adopt Owner Authority
F\ QUSCRTUS - Create User Space
F\ QUSROBJD - Retrieve Object Description /
F\ QUSRTVUS - Retrieve From User Space /
F\
F\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
F\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
F\
FQSYSPRT O F 132 OF PRINTER
F\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
I/COPY QSYSINC/QRPGSRC,QSYLOBJP
I/COPY QSYSINC/QRPGSRC,QUSROBJD
I/COPY QSYSINC/QRPGSRC,QUSGEN
C\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
I\ Error Code Structure
I\
I\ This shows how the user can define the variable length portion
5-4 System API Programming V4R1