IBM AS/400 Frozen Dessert Maker User Manual


 
Using Externally Described Disk Files
RPG program, an edit code must be specified for the field in the output
specifications.
2 The CHECK(MF) entry specifies that the field is a mandatory fill field
when it is entered from a display work station. Mandatory fill means that
all characters for the field must be entered from the display work station.
3 The ADDR and CITY fields share the same attributes that are specified
for the NAME field, as indicated by the REFFLD keyword.
4 The RANGE keyword, which is specified for the CUSTYP field, ensures
that the only valid numbers that can be entered into this field from a
display work station are 1 through 5.
5 The COLHDG keyword provides a column head for the field if it is used
by the Interactive Database Utilities (IDU).
6 The ARBAL field is edited by the J edit code, as indicated by the
keyword EDTCDE(J).
7 A text description (TEXT keyword) is provided for some fields. The
TEXT keyword is used for documentation purposes and appears in
various listings.
Valid Keys for a Record or File
For a keyed-sequence access path, you can define one or more fields in the DDS
to be used as the key fields for a record format. (However, variable-length fields
cannot be used as key fields in an RPG program.) All record types in a file do not
have to have the same key fields. For example, an order header record can have
the ORDER field defined as the key field, and the order detail records can have the
ORDER and LINE fields defined as the key fields.
The key for a file is determined by the valid keys for the record types in that file.
The file’s key is determined in the following manner:
If all record types in a file have the same number of key fields defined in the
DDS that are identical in attributes, the
key for the file
consists of all fields in
the key for the record types. (The corresponding fields do not have to have the
same name.) For example, if the file has three record types and the key for
each record type consists of fields A, B, and C, the file’s key consists of fields
A, B, and C. That is, the file’s key is the same as the records’ key.
If all record types in the file do not have the same key fields, the key for the file
consists of the key fields
common
to all record types. For example, a file has
three record types and the key fields are defined as follows:
REC1 contains key field A.
REC2 contains key fields A and B.
REC3 contains key fields A, B, and C.
The file’s key is field A–the key field common to all record types.
If no key field is common to all record types, there is no key for the file.
In an ILE RPG program, you can specify a search argument on certain file opera-
tion codes to identify the record you want to process. The ILE RPG program com-
pares the search argument with the key of the file or record, and processes the
specified operation on the record whose key matches the search argument.
Chapter 16. Accessing Database Files 285