Understanding the MICRTPG Program (by

Sections

of Code)

You

will recognize

some of

these statements from the MI01 example, bu

are

new.

 

 

The following statements, which you have seen, for example, in “MI01 Program—Complete Code Example,” define the entry point to this program an parameters being passed on the call:

ENTRY \ (PARM_LIST) EXT;

DCL SPCPTR MBR@ PARM;

DCL SPCPTR BINOFFSET@ PARM;

DCL OL PARM_LIST (MBR@, BINOFFSET@) PARM EXT;

DCL DD MBR CHAR(1ð) BAS(MBR@);

DCL DD BINOFFSET BIN(4) BAS(BINOFFSET@);

Declaring the Structure

The following, however, are new statements:

DCL DD RSLVOBJ CHAR(34);

DCL DD RSLVTYPE CHAR(1) DEF(RSLVOBJ) POS(1) INIT(X'19');

DCL DD RSLVSUBTYPE CHAR(1) DEF(RSLVOBJ) POS(2) INIT(X'34');

DCL DD RSLVNAME CHAR(3ð) DEF(RSLVOBJ) POS(3);

DCL DD RSLVAUTH CHAR(2) DEF(RSLVOBJ) POS(33) INIT(X'ðððð');

These statements declare a structure named RSLVOBJ that comprises four ments defined within it. The subelements specify their position relative of the structure RSLVOBJ. In the cases of the RSLVTYPE, RSLVSUBTYPE, an RSLVAUTH data elements, they initialize the associated storage.

The RSLVOBJ structure is used later in

the program as an input

to

th

system pointer (RSLVSP) MI instruction. The

RSLVSP

instruction

resolves

(esta

lishes addressability) to a user space '1934(*USRSPC)' object(the typeX and

 

 

subtype) named RSLVNAME (assigned from the

 

source member name (MBR) data

element). This user space is the one

created

in

“Source

for

the

CL03

page 7-13.

If

you are interested in the details of thisMachinestructure, see the

Interface Functional Referundencer RSLVSP. For other valid object types and

 

subtypes, AS/400see Licensed Internal Code

Diagnostic

Aids,

Volume 1

 

 

LY44-5900, and AS/400 Licensed Internal

Code

 

Diagnostic

Aids,

– Volume

2

 

LY44-5901.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Note: In

the

declare

(DCL) statement

 

of

RSLVOBJ, the leading blanks use

indent the subelements (for example, RSLVTYPE and RSLVSUBTYPE) are

 

strictly

to

enhance

the

readability

 

of the source. They are

not

of the QPRCRTPG API. In general, you

 

can use strings of blanks of

length in the source of a program.

Blanks, one or more, are

simply

delimiters

in

identifying

tokens. The

 

major

exception

is

the

INIT

of

a

DCL

 

statement

where

the

number

of

blanks

is

important.

For

ex

the previous declare statement could

have

been written

as

follows

than

 

readability,

nothing

would

have

 

been

lost:

 

 

 

 

 

DCL DD RSLVOBJ CHAR(34); DCL DD RSLVTYPE CHAR(1)

 

 

 

 

 

 

 

DEF(RSLVOBJ) POS(1) INIT(X'19');

DCL DD RSLVSUBTYPE CHAR(1)

 

 

 

DEF(RSLVOBJ)

 

 

 

 

 

 

 

 

POS(2)

 

 

 

 

 

 

 

INIT(X'34'); DCL DD RSLVNAME CHAR(3ð) DEF(RSLVOBJ) POS(3); DCL

DD RSLVAUTH CHAR(2) DEF(RSLVOBJ) POS(33) INIT(X'ðððð');

7-16System API Programming V4R1

Page 156
Image 156
IBM Version 4 Code, Declaring the Structure, Understanding the Micrtpg Program by, Following, however, are new statements