MONMSG

MSGID(CPFð864) EXEC(GOTO CMDLBL(CRTPGM))

 

CHGVAR

VAR(%SST(&MIPGMSRC &OFFSET 8ð)) VALUE(&SRCDTA)

 

CHGVAR

VAR(&OFFSET) VALUE(&OFFSET + 8ð)

 

GOTO

CMDLBL(LOOP)

CRTPGM:

CHGVAR

VAR(%SST(&PGMNAM 1 1ð)) VALUE(&SRCMBR)

 

CHGVAR

VAR(%BIN(&MIPGMSRCSZ)) VALUE(&OFFSET)

 

CALL

PGM(QSYS/QPRCRTPG) PARM(&MIPGMSRC +

 

 

&MIPGMSRCSZ &PGMNAM &PGMTXT &PGMSRCF +

 

 

&PGMSRCM &PGMSRCCHG &PRTFNAM &PRTSTRPAG +

 

ENDPGM

&PGMPUBAUT &PGMOPTS &NUMOPTS)

 

 

Creating the MI Example Program

After creating the CL program (assumed to be called CLCRTPG), the follow statements create the previous MI program MI01:

DLTOVR MISRC

OVRDBF MISRC MBR(MIð1)

CALL CLCRTPG MIð1

Note: If

the

creation

of

MI01

fails, you should closely compare your

shown in this chapter. In

general, consider the QPRCRTPG error mes-

sages that refer to “probable compiler error”

as referring

to

source and not that the

QPRCRTPG API itself is in error. (QPRCRTPG

assumes

its

input

is

probably

from a high-level

language

(HLL)

compi

If the error message is

CPF6399 (Identifier not declared), you

object definition table (ODT) listing by adding *XREF to the optio

parameter (variable

&PGMOPTS

in

the

CLCRTPG

program)

when calling

 

the QPRCRTPG API. Add *XREF

to the existing *LIST and *REPLACE

 

options, and change the number

of

option

template entries

paramete

able

&NUMOPTS)

to

3.

 

 

 

 

 

 

 

 

Testing MI01

 

In

this topic,

assume that MI01 was successfully

created. Test the MI

 

with the following CL01 CL program:

 

 

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

 

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

 

/\

 

 

\/

 

/\

Program Name: CLð1

\/

 

/\

 

 

\/

 

/\

Programming Language: CL

\/

 

/\

 

 

\/

 

/\

Description: Test the MI program MIð1.

\/

 

/\

 

 

\/

 

/\

 

 

\/

 

/\

Header Files Included: None

\/

 

/\

 

 

\/

 

/\

 

 

\/

 

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/

 

 

PGM

PARM(&ARG1 &ARG2)

 

 

 

DCL

VAR(&ARG1) TYPE(\DEC) LEN(15 5)

 

 

 

DCL

VAR(&ARG2) TYPE(\DEC) LEN(15 5)

 

 

 

DCL

VAR(&RESULT) TYPE(\DEC) LEN(15 5)

 

 

 

DCL

VAR(&MSG) TYPE(\CHAR) LEN(2ð)

 

 

 

DCL

VAR(&USR) TYPE(\CHAR) LEN(1ð)

 

7-6

System API Programming

V4R1

 

 

Page 146
Image 146
IBM Version 4 manual Creating the MI Example Program, Testing MI01