IBM AS/400 Frozen Dessert Maker User Manual


 
Database Files
Chapter 16. Accessing Database Files
You can access a database file from your program by associating the file name
with the device DISK in the appropriate file specification.
DISK files of an ILE RPG program also associate with distributed data management
(DDM) files, which allow you to access files on remote systems as database files.
Database Files
Database files are objects of type *FILE on the AS/400. They can be either phys-
ical or logical files and either externally described or program-described. You
access database files by associating the file name with the device DISK in positions
36 through 42 of the file description specifications.
Database files can be created by OS/400 Create File commands. For more infor-
mation on describing and creating database files, refer to the
DB2 UDB for AS/400
Database Programming
manual and the
DDS Reference
.
Physical Files and Logical Files
Physical files contain the actual data that is stored on the system, and a
description of how data is to be presented to or received from a program. They
contain only one record format, and one or more members. Records in database
files can be externally or program-described.
A physical file can have a keyed sequence access path. This means that data is
presented to a program in a sequence based on one or more key fields in the file.
Logical files do not contain data. They contain a description of records found in
one or more physical files. A logical file is a view or representation of one or more
physical files. Logical files that contain more than one format are referred to as
multi-format logical files.
If your program processes a logical file which contains more than one record
format, you can use a read by record format to set the format you wish to use.
Data Files and Source Files
A data file contains actual data, or a view of the data. Records in data files are
grouped into members. All the records in a file can be in one member or they can
be grouped into different members. Most database commands and operations by
default assume that database files which contain data have
only one
member. This
means that when your program accesses database files containing data, you do not
need to specify the member name for the file unless your file contains more than
one member. If your file contains more than one member and a particular member
is not specified, the first member is used.
Usually, database files that contain source programs are made up of more than one
member. Organizing source programs into members within database files allows
you to better manage your programs. The source member contains source state-
ments that the system uses to create program objects.
Copyright IBM Corp. 1994, 1999 281