IBM AS/400 manual EXFMT Operation, READ Operation, WRITE Operation, Multiple-Device Files

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 366
Image 366
Multiple-Device Files

Multiple-Device Files

EXFMT Operation

The EXFMT operation is a

combination of a WRITE followed by a READ to

same

record

format

(it

corresponds to

a data management WRITE-READ ope

tion). If you define a WORKSTN file on the file description specifica

procedural

(F

in position

18)

combined file

(C in

position 17) that use

externally-described

data

(E

in

position

22) the EXFMT (execute format)

code

can

be

used

to write

and

read

from

the

display.

READ Operation

The

READ operation

is

valid for a

full-procedural

combined

file

or a

f

input file that uses externally-described data or program-described da

operation

retrieves

a

record from the display. However, a format must

device

before

any

input

operations

can

occur.

This

requirement

can

be

a display

device

 

by

conditioning

an

output

record

with

the 1P

indicat

the

first

format

to

the

device

from another program, or, if the rea

format

name, by

using

the

keyword

INZRCD

on

the

record

description

in

WRITE Operation

The

WRITE

operation

writes a new record to a

display and is valid f

file

or

an

output

file.

Output

specifications and the EXCEPT operation

used

to

write to

a WORKSTN

fileILE. SeeRPG

forthe AS/400

Referencefor a

complete

description

of

each

of

these

operation

codes.

Multiple-Device Files

Any RPG WORKSTN file with at least one of the keywords DEVID, SAVEIND, MAXDEV(*FILE) or SAVEDS specified on the file description specification is multiple-device file. Through a multiple-device file, your program may ac than one device.

The RPG program accesses devices through program devices, which are s

mechanisms for directing operations to an

actual device. When you crea

(using

the

DDS and

commands

such as the

create file

commands),

you

con

such

things

as which device is associated with a program device,

whe

file

has

a

requesting program device, which record formats will be

us

devices

to

respond

to a

READ-by-file-name

operation, and

how long

this

R

operation will wait for a response. For detailed information on the opt

requirements for

creating

a multiple-device file, see the

chapter

on d

Data Management manual, and information on ICFICFfilesProgramming

 

 

 

manual, and the manuals you

are referred to in these

two

publications.

With multiple-device files,

you make particular use of

the

following

ope

¹ In addition to opening

a file, the OPEN operation implicitly acquires

you specify

when you

create the file.

 

 

 

¹The ACQ (acquire) operation acquires any other devices for a multip file.

¹ The REL (release) operation releases a device from the file.

¹The WRITE operation, when used with the DDS keyword INVITE, invites program device to respond to subsequent read-from-invited- program-devi

342 ILE RPG for AS/400 Programmer's Guide

Page 366
Image 366
IBM AS/400 manual EXFMT Operation, READ Operation, WRITE Operation, Multiple-Device Files