IBM AS/400 Frozen Dessert Maker User Manual


 
Multiple-Device Files
EXFMT Operation
The EXFMT operation is a combination of a WRITE followed by a READ to the
same record format (it corresponds to a data management WRITE-READ opera-
tion). If you define a WORKSTN file on the file description specifications as a full-
procedural (F in position 18) combined file (C in position 17) that uses
externally-described data (E in position 22) the EXFMT (execute format) operation
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 full-procedural
input file that uses externally-described data or program-described data. The READ
operation retrieves a record from the display. However, a format must exist at the
device before any input operations can occur. This requirement can be satisfied on
a display device by conditioning an output record with the 1P indicator, by writing
the first format to the device from another program, or, if the read is by record-
format name, by using the keyword INZRCD on the record description in the DDS.
WRITE Operation
The WRITE operation writes a new record to a display and is valid for a combined
file or an output file. Output specifications and the EXCEPT operation can also be
used to write to a WORKSTN file. See the
ILE RPG for AS/400 Reference
for 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 a
multiple-device file. Through a multiple-device file, your program may access more
than one device.
The RPG program accesses devices through program devices, which are symbolic
mechanisms for directing operations to an actual device. When you create a file
(using the DDS and commands such as the create file commands), you consider
such things as which device is associated with a program device, whether or not a
file has a requesting program device, which record formats will be used to invite
devices to respond to a READ-by-file-name operation, and how long this READ
operation will wait for a response. For detailed information on the options and
requirements for creating a multiple-device file, see the chapter on display files in
Data Management
manual, and information on ICF files in
ICF Programming
manual, and the manuals you are referred to in these two publications.
With multiple-device files, you make particular use of the following operation codes:
In addition to opening a file, the OPEN operation implicitly acquires the device
you specify when you create the file.
The ACQ (acquire) operation acquires any other devices for a multiple-device
file.
The REL (release) operation releases a device from the file.
The WRITE operation, when used with the DDS keyword INVITE, invites a
program device to respond to subsequent read-from-invited- program-devices
342 ILE RPG for AS/400 Programmer's Guide