IBM AS/400 manual Using SPECIAL Files, User-written program USERIO, Plistspcl

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 354
Image 354
User-written program USERIO

Using SPECIAL Files

*..

1

...+...

2 ...

+

... 3 ...

+

... 4 ...

+...

5 ...

+...

6 ...

+...

7

...+...

*

DName+++++++++++ETDsFrom+++To/L+++IDc.Functions++++++++++++++++++++++++++++

D ERROR

S

 

 

 

5S 0

 

 

 

 

 

 

 

 

*..

1

...+...

2 ...

+

... 3 ...

+

... 4 ...

+...

5 ...

+...

6 ...

+...

7

...+...

*

CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq.￿

...

*----------------------------------------------------------------

 

 

 

 

 

 

 

 

 

 

 

 

*

 

* The first 4 parameters are ILE RPG created parameter list￿.

 

*

 

* The rest are defined by the programmer-defined PLIST.

 

 

*

 

*----------------------------------------------------------------

 

 

 

 

 

 

 

 

 

 

 

 

*

 

C

 

*ENTRY

 

 

PLIST

 

 

 

 

 

 

 

 

 

 

C

 

 

 

 

PARM

 

 

 

OPTION

 

1

 

 

 

C

 

 

 

 

PARM

 

 

 

STATUS

 

1

 

 

 

C

 

 

 

 

PARM

 

 

 

ERROR

 

 

5 0

 

 

C

 

 

 

 

PARM

 

 

 

AREA

 

 

20

 

 

 

C

 

 

 

 

PARM

 

 

 

FLD1

 

 

1

 

 

 

*----------------------------------------------------------------

 

 

 

 

 

 

 

 

 

 

 

 

*

 

* The user written

 

program will perform the file I/O accord￿ing

 

*

 

* to the option passed.

 

 

 

 

 

 

 

 

*

 

*----------------------------------------------------------------

 

 

 

 

 

 

 

 

 

 

 

 

*

 

C

 

 

 

 

SELECT

 

 

 

 

 

 

 

 

 

 

C

 

 

 

 

WHEN

 

OPTION = 'O'

 

 

 

 

 

 

 

C*

perform OPEN operation

 

 

 

 

 

 

 

 

 

 

C

 

 

 

 

WHEN

 

OPTION = 'W'

 

 

 

 

 

 

 

C*

perform WRITE operation

 

 

 

 

 

 

 

 

 

 

C

 

 

 

 

WHEN

 

OPTION = 'C'

 

 

 

 

 

 

 

C*

perform CLOSE operation

 

 

 

 

 

 

 

 

 

 

C

 

 

 

 

ENDSL

 

 

 

 

 

 

 

 

 

 

C

 

 

 

 

RETURN

 

 

 

 

 

 

 

 

 

 

Figure 164.

User-written program USERIO

 

 

 

 

 

 

The

I/O operations for the SPECIAL device are controlled

by

the

user-

program USERIO. The parameters specified for the programmer-defined

 

PLIST(SPCL)

are

added

to the end of the RPG-created

parameter list

fo

SPECIAL

device. The programmer-specified parameters

can

be

accessed

by

user

ILE

RPG

program

and the user-written routine

USERIO;

whereas

the

RPG-created

parameter

list can be accessed only

by

internal

ILE

RPG

l

the

user-written routine.

 

 

 

 

 

 

330 ILE RPG for AS/400 Programmer's Guide

Page 354
Image 354
IBM AS/400 manual Using SPECIAL Files, User-written program USERIO, Plistspcl