IBM AS/400 Frozen Dessert Maker User Manual


 
Using Externally Described WORKSTN Files
specifications require that a relative-record-number field be specified in the second
position of the SFILE keyword on the file description specification.
If a WORKSTN file has an associated subfile, all implicit input operations and
explicit calculation operations that refer to the file name are processed against the
main WORKSTN file. Any operations that specify a record format name that is not
designated as a subfile are processed on the main WORKSTN file.
If you press a specified function key during a read of a non-subfile record, subse-
quent reads of a subfile record will cause the corresponding function key indicator
to be set on again, even if the function key indicator has been set off between the
reads. This will continue until a non-subfile record is read from the WORKSTN file.
*.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ..*
AAN01N02N03T.Name++++++RLen++TDpBLinPosFunctions++++++++++++++++++++*
A** CUSTOMER NAME SEARCH
A REF(DSTREF) 1
A R SUBFIL SFL 2
A TEXT('Subfile Record')
A CUST R 7 3
A NAME R 7 10
A ADDR R 7 32 3
A CITY R 7 54
A STATE R 7 77
A*
Figure 167. Data Description Specifications for a Subfile Record Format
The data description specifications (DDS) for a subfile record format describe the
records in the subfile:
1 The attributes for the fields in the record format are contained in the field
reference file DSTREF as specified by the REF keyword.
2 The SFL keyword identifies the record format as a subfile.
3 The line and position entries define the location of the fields on the
display.
Use of Subfiles
Some typical ways you can make use of subfiles include:
Display only. The work-station user reviews the display.
Display with selection. The user requests more information about one of the
items on the display.
Modification. The user changes one or more of the records.
Input only, with no validity checking. A subfile is used for a data entry function.
Input only, with validity checking. A subfile is used for a data entry function, but
the records are checked.
Combination of tasks. A subfile can be used as a display with modification, plus
the input of new records.
The following figure shows an example of data description specifications for a
subfile control-record format. For an example of using a subfile in an RPG program,
see “Search by Zip Code” on page 358.
Chapter 18. Using WORKSTN Files 337