Using CLCRTPG to Create

an

MI

Program

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Assume that the source is in

a member named MI01 in the

source

fil

which is created with a default

 

record

length

(RCDLEN)

of

92.

The f

CLCRTPG CL program can be used

to

create

an

MI

program

called

MI01.

program

to

call

the Create Program (QPRCRTPG) API is developed

in

“Crea

MI

Version

of

CLCRTPG”

on

page 7-11.)

 

 

 

 

 

 

 

 

 

 

Note:

All

non-MI

source

examples

are provided in CL, because

CL

is

the

 

guage (other

than

REXX)

that

is

standard

on all

AS/400

systems.

 

high-level

languages

(HLLs)

could

be used in

place

of

the

CL

pro

 

(and

in

many

cases

would

have

been

easier).

 

 

 

 

 

 

The following program reads a

source file

member

into

a

program

varia

(&MIPGMSRC)

and

then

does

a

CALL

to the QPRCRTPG API. This program has

many

limitations

(the

major

limitation

is

a

program variable-size limit o

for the source), but provides for a reasonably simple MI program cr

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

 

 

 

 

 

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

 

 

 

 

 

/\

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

\/

 

 

 

 

 

/\

Program Name: CLCRTPG

 

 

 

 

 

 

 

 

 

\/

 

 

 

 

 

/\

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

\/

 

 

 

 

 

/\

Programming Language: CL

 

 

 

 

 

 

 

 

\/

 

 

 

 

 

/\

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

\/

 

 

 

 

 

/\

Description: Create an MI program using the QPRCRTPG API.

\/

 

 

 

 

 

/\

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

\/

 

 

 

 

 

/\

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

\/

 

 

 

 

 

/\

Header Files Included: None

 

 

 

 

 

 

 

\/

 

 

 

 

 

/\

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

\/

 

 

 

 

 

/\

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

\/

 

 

 

 

 

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

 

 

 

 

 

 

 

 

PGM

 

PARM(&SRCMBR)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DCLF

 

FILE(MISRC)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DCL

 

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

 

 

 

 

 

 

 

 

 

 

DCL

 

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

 

 

 

 

 

 

 

 

 

 

DCL

 

VAR(&MIPGMSRCSZ) TYPE(\CHAR) LEN(4)

 

 

 

 

 

 

 

 

 

 

DCL

 

VAR(&OFFSET) TYPE(\DEC) LEN(5 ð) VALUE(1)

 

 

 

 

 

 

 

 

 

DCL

 

VAR(&PGMNAM) TYPE(\CHAR) LEN(2ð) +

 

 

 

 

 

 

 

 

 

 

 

 

VALUE('

 

 

\CURLIB

')

 

 

 

 

 

 

 

 

 

 

 

DCL

 

VAR(&PGMTXT) TYPE(\CHAR) LEN(5ð) +

 

 

 

 

 

 

 

 

 

 

 

 

VALUE('Compare two packed arguments and +

 

 

 

 

 

 

 

 

 

 

 

return larger')

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DCL

 

VAR(&PGMSRCF) TYPE(\CHAR) LEN(2ð) +

 

 

 

 

 

 

 

 

 

 

 

 

VALUE('\NONE')

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DCL

 

VAR(&PGMSRCM) TYPE(\CHAR) LEN(1ð) VALUE(' ')

 

 

 

 

 

 

 

 

DCL

 

VAR(&PGMSRCCHG) TYPE(\CHAR) LEN(13) VALUE(' ')

 

 

 

 

 

 

 

 

DCL

 

VAR(&PRTFNAM) TYPE(\CHAR) LEN(2ð) +

 

 

 

 

 

 

 

 

 

 

 

 

VALUE('QSYSPRT

\LIBL

 

')

 

 

 

 

 

 

 

 

 

 

 

DCL

 

VAR(&PRTSTRPAG) TYPE(\CHAR) LEN(4) +

 

 

 

 

 

 

 

 

 

 

 

 

VALUE(X'ððððððð1')

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DCL

 

VAR(&PGMPUBAUT) TYPE(\CHAR) LEN(1ð) +

 

 

 

 

 

 

 

 

 

 

 

 

VALUE('\ALL

 

')

 

 

 

 

 

 

 

 

 

 

 

 

 

DCL

 

VAR(&PGMOPTS) TYPE(\CHAR) LEN(22) +

 

 

 

 

 

 

 

 

 

 

 

 

VALUE('\LIST

 

\REPLACE

 

')

 

 

 

 

 

 

 

 

 

 

DCL

 

VAR(&NUMOPTS) TYPE(\CHAR) LEN(4) +

 

 

 

 

 

 

 

LOOP:

 

RCVF

 

VALUE(X'ððððððð2')

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Chapter

7.

Machine

Interface

Programming7-5

 

 

 

Page 145
Image 145
IBM Version 4 manual Using Clcrtpg to Create, Rexx