IBM AS/400 Frozen Dessert Maker User Manual


 
Using Externally Described WORKSTN Files
Customer Name Search
Search Code _______
Number Name Address City State
XXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XX
XXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XX
XXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XX
XXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XX
XXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XX
XXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XX
XXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XX
XXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XX
XXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XX
XXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XX
XXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XX
XXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XX
XXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XX
XXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XX
XXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XX
XXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XX
XXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XX
XXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXX XX
Figure 166. Subfile Display
To use a subfile for a display device file in an RPG program, you must specify the
SFILE keyword on a file description specification for the WORKSTN file. The format
of the SFILE keyword is SFILE(
record format name
:
RECNO field name
). The
WORKSTN file must be an externally-described file (E in position 22).
You must specify for the SFILE keyword the name of the subfile record format (not
the control-record format) and the name of the field that contains the relative record
number to be used in processing the subfile.
In an RPG program, relative record number processing is defined as part of the
SFILE definition. The SFILE definition implies a full-procedural update file with ADD
for the subfile. Therefore, the file operations that are valid for the subfile are not
dependent on the definition of the main WORKSTN file. That is, the WORKSTN
file can be defined as a primary file or a full-procedural file.
Use the CHAIN, READC, UPDATE, or WRITE operation codes with the subfile
record format to transfer data between the program and the subfile. Use the READ,
WRITE, or EXFMT operation codes with the subfile control-record format to transfer
data between the program and the display device or to process subfile control oper-
ations.
Subfile processing follows the rules for relative-record-number processing. The
RPG program places the relative-record number of any record retrieved by a
READC operation into the field named in the second position of the SFILE
keyword. This field is also used to specify the record number that the RPG program
uses for WRITE operation to the subfile or for output operations that use ADD. The
RECNO field name specified for the SFILE keyword must be defined as numeric
with zero decimal positions. The field must have enough positions to contain the
largest record number for the file. (See the SFLSIZ keyword in the
DDS
Reference
.) The WRITE operation code and the ADD specification on the output
336 ILE RPG for AS/400 Programmer's Guide