IBM Version 4 manual Binoffset, Ovrdbf, Qcmdexc API

Models: Version 4

1 505
Download 505 pages 30.92 Kb
Page 160
Image 160

7.To keep track of how many bytes of source are loaded into the * define BINOFFSET. BINOFFSET is also being defined very specifically as integer (BIN(4)) because it will be used later in the program wit pointer offset (SETSPPO) MI instruction. This requires an integer argume refer to the space:

DCL DD BINOFFSET BIN(4) AUTO INIT(ð);

8.Because the size of the source define a space pointer to refer

DCL SPCPTR BINOFFSET@ AUTO INIT(BINOFFSET);

is

also a parameter to the QPRCR

to

BINOFFSET:

The

two

previous declare

statements

have

also

introduced

a

new

attr

the

DCL

statement. Previously, all of the DCLs

used

the

default

of

 

(STAT) storage. BINOFFSET and BINOFFSET@, on the other hand, are being

 

allocated from automatic (AUTO) storage. Many hours of

 

debug

time

c

saved if you clearly understand how the

AS/400

manages

 

these

two

ty

storage. For more information on the types

of

storage,

 

see

“AS/400

Pro

Storage”

on

page 7-36.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

So that

the program does not retain the

size of the source loade

vious invocations of the program, you can

declare

BINOFFSET

as

being

 

matic. Because

BINOFFSET@

needs to be

set

to

the

address

 

of

BINOFFSE

(so that BINOFFSET can be passed as a parameter

to

CL06),

you

will

a

declare it as automatic. An alternative to

using

automatic

storage

wo

been

to

explicitly set a static storage

BINOFFSET

to

0

by

using

CPYN

this

does

not

allow for

a

discussion

of

the

storage

 

management

diff

9.Use the CL06 program to load the space after it is created. Bec limited to only 2000 bytes of addressability per parameter per call

MICRTPG2

program

uses

the

Override

with

Database

File

(OVRDBF)

CL

 

command

to cause

the

CL06

program

to

read

and load twenty 80-byte

so

records

per call. The source records

are

read

starting at 1

on

t

on the

second, 41 on the third, and

so on. To run CL commands from

MICRTPG2

program,

the

program uses

the

Execute Command

(QCMDEXC)

 

 

API:

 

 

 

 

 

 

 

 

 

 

 

 

DCL SYSPTR QCMDEXC INIT("QCMDEXC", CTX("QSYS"), TYPE(PGM));

10.Format the appropriate character strings for the Override with Dat (OVRDBF) CL command:

Note: In

the following

declare

(DCL) statement for CLOVRCMD,

the 3 str

of

'1234567890'

are

used

strictly so

that you can see that 1

being used. The strings themselves are overridden by the subs

subelement

DCLs

for

FILNAM,

MBRNAM, and

RECNUM, and could

be

replaced

by

10

blanks:

 

 

 

DCL DD CLOVRCMD CHAR(65);

DCL DD OVRSTR CHAR(39) DEF(CLOVRCMD) POS(1)

INIT("OVRDBF MISRC 123456789ð MBR(123456789ð)");

DCL DD OVRSTR2 CHAR(26) DEF(CLOVRCMD) POS(4ð)

INIT(" POSITION(\RRN 123456789ð)");

DCL DD FILNAM CHAR(1ð) DEF(CLOVRCMD) POS(14);

DCL DD MBRNAM CHAR(1ð) DEF(CLOVRCMD) POS(29);

DCL DD RECNUM ZND(1ð,ð) DEF(CLOVRCMD) POS(55);

11.Format the appropriate character strings for the Delete Override command. Because the OVRDBF commands are issued repetitively to progress through the source, the previous overrides need to be d

7-20System API Programming V4R1

Page 160
Image 160
IBM Version 4 manual Binoffset, Ovrdbf, Qcmdexc API