IBM AS/400 manual Using SPECIAL Files

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 351
Image 351
Using SPECIAL Files

Using SPECIAL Files

Example

of

Specifying

a

Sequential

File

 

 

 

 

 

 

 

 

 

Figure 162

shows

an

example

of

how

to

specify

a

SEQ

file

in an

ILE

member.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

*.. 1 + 2 + 3 + 4 + 5 + 6 + 7 + *

FFilename++IPEASFRlen+LKlen+AIDevice+.Keywords+++++++++++++++++++++++++++++

 

 

FTIMECDS

IP

E

 

DISK

 

 

 

 

 

 

 

 

 

 

FPAYOTIME

O

F 132

SEQ

 

 

 

 

 

 

 

 

 

 

*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure

162.

SEQ Device

 

 

 

 

 

 

 

 

 

 

 

A SEQ

device

is

specified

for

the

PAYOTIME

file.

When the

program i

can use

a OS/400 override command to specify the actual device (su

tape,

or

diskette)

to be

associated

with

the

file

while

the

progr

example, diskette can be specified for some program runs while print specified for others. The file description, pointed to by the file actual device, in which case an override command need not be used.

Using SPECIAL Files

The RPG device name SPECIAL (positions

36 - 42 of the file descripti

tions) allows you to specify an input

and/or output device that is n

ported by the ILE RPG operations. The input and output operations f controlled by a user-written routine. The name of the user-written ro

identified in the file description specifications using

the

keyword

PGMNAME('

program name').

 

 

ILE RPG

calls

this user-written routine to open the file,

read and w

and close the file. ILE RPG also creates a parameter

list

for use

routine.

The

parameter list contains:

 

 

¹ option code parameter (option)

¹ return status parameter (status)

¹error-found parameter (error)

¹record area parameter (area).

This parameter list is accessed by the ILE RPG compiler and by th routine; it cannot be accessed by the program that contains the SPEC

The following describes the parameters in this RPG-created parameter

Option

The

option parameter

is

a one-position character field that

 

action the user-written

routine is to process. Depending on t

 

being

processed

on

the

SPECIAL file (OPEN,

CLOSE,

FEOD,

READ,

 

WRITE,

DELETE,

UPDATE),

one

of

the

following

values

is

passed to

 

the user-written routine

from

ILE

RPG:

 

 

 

 

Value

Passed Description

 

 

 

 

 

 

 

 

 

O

 

Open

the

file.

 

 

 

 

 

 

 

C

 

Close

the

file.

 

 

 

 

 

 

FForce the end of file.

Chapter 17. Accessing Externally Attached327 Devices

Page 351
Image 351
IBM AS/400 manual Using SPECIAL Files