Because the CLCRTPG program is used to create the initial version of MICRTPG
and CLCRTPG can support only as many as 2000 bytes of source in the
&MIPGMSRC variable, MICRTPG is initially defined with a minimal set of function.
Significant additions to the MICRTPG program can be made after it is used as a
building block in the creation of MI programs.
In the initial design (see the program flow on page 7-13), there are four programs.
The first program is a CL program (CL03) that does the following:
Creates a user space (*USRSPC) object of 64KB size to hold the MI source.
Overrides the MISRC file to the appropriate source physical file and
member1.
Calls a second CL program (CL04), which loads the selected MISRC member
into the user space (*USRSPC)2.
Calls an MI program (MICRTPG)3. The MICRTPG program calls CL
program CL054 and passes addressability to the *USRSPC, where CL05
then calls the QPRCRTPG API5.
The MICRTPG program demonstrates how to do the following:
Define a structure
Initialize declared storage
Use two different approaches to resolve a system pointer to an external object
Assign a space pointer to address a user space
Call a program and pass three parameters
The overall program flow appears as follows:
CL Pgm CL03
CL Pgm CL04
USRSPC
MI Pgm MICRTPG
CL Pgm CL05
API
QPRCRTPG
RV3W216-2
MISRC
Figure 7-1. Program Flow for Creating the MICRTPG Program
7-12 System API Programming V4R1