IBM AS/400 Frozen Dessert Maker User Manual


 
Using Externally Described WORKSTN Files
Processing an Externally Described WORKSTN File
When an externally-described WORKSTN file is processed, the OS/400 system
transforms data from the program to the format specified for the file and displays
the data. When data is passed to the program, the data is transformed to the
format used by the program.
The OS/400 system provides device-control information for processing input/output
operations for the device. When an input record is requested from the device, the
OS/400 system issues the request, and then removes device-control information
from the data before passing the data to the program. In addition, the OS/400
system can pass indicators to the program indicating which fields, or if any fields, in
the record have been changed.
When the program requests an output operation, it passes the output record to the
OS/400 system. The OS/400 system provides the necessary device-control infor-
mation to display the record. It also adds any constant information specified for the
record format when the record is displayed.
When a record is passed to a program, the fields are arranged in the order in which
they are specified in the DDS. The order in which the fields are displayed is based
on the display positions (line numbers and position) assigned to the fields in the
DDS. The order in which the fields are specified in the DDS and the order in which
they appear on the screen need not be the same.
For more information on processing WORKSTN files, see “Valid WORKSTN File
Operations” on page 341.
Using Subfiles
Subfiles can be specified in the DDS for a display-device file to allow you to handle
multiple records of the same type on the display. (See Figure 166 on page 336.) A
subfile is a group of records that is read from or written to a display-device file. For
example, a program reads records from a database file and creates a subfile of
output records. When the entire subfile has been written, the program sends the
entire subfile to the display device in one write operation. The work-station user can
change data or enter additional data in the subfile. The program then reads the
entire subfile from the display device into the program and processes each record
in the subfile individually.
Records that you want to be included in a subfile are specified in the DDS for the
file. The number of records that can be included in a subfile must also be specified
in the DDS. One file can contain more than one subfile, and up to 12 subfiles can
be active concurrently. Two subfiles can be displayed at the same time.
The DDS for a subfile consists of two record formats: a subfile-record format and a
subfile control-record format. The subfile-record format contains the field information
that is transferred to or from the display file under control of the subfile control-
record format. The subfile control-record format causes the physical read, write, or
control operations of a subfile to take place. Figure 167 on page 337 shows an
example of the DDS for a subfile-record format, and Figure 168 on page 338
shows an example of the DDS for a subfile control-record format.
For a description of how to use subfile keywords, see the
DDS Reference
.
Chapter 18. Using WORKSTN Files 335