This module covers the creation and maintenance of the database objects using the DDS(Data Description Specification) Method.
DDS is a language using which the data attributes of a record are described.
Database objects can be a physical file(source or data) or a logical file(join or non-join).
They contain the descriptions of how the data is to be stored and retrieved from the object
Terminologies:
Source Physical File: Contains source statements(uncompiled) of high-level language programs or the DDS of files. When the source member containing the source statements is compiled, an object is created. The source file is used when the command alone is not sufficient to create an object.
Physical File: Stores the actual information. It also contains the description of how the data is actually stored in the object and how a program retrieves the data. From the SQL perspective, it is equivalent to a table.
Logical File: Does not contain data of its own. Retrieves the data from based on Physical files. Used to retrieve the data in a different sequence, to filter the data using selection criteria, to work with only a subset of fields and also to get data from more than one physical file. From the SQL perspective, it is equivalent to a view or an index.
Member: The data of the Physical file is actually stored in its members. Members of the source physical file are called source members and those of the Physical file are called data members.
A file can have up to 32767 members. Each member stores a subset of data with the same format.
Record: Within a member the data is stored as records in the way that is described in DDS. A record is a group of fields. From the SQL perspective, a record is a row of a table.
Fields: Occupies one or more bytes of memory in the record, which stores specific information like Employee ID, First Name, etc. From the SQL perspective, a field is a column of a row of a table.
Example DDS Code
Here’s a simple example of DDS code to create a physical file with a single record format:
plaintext
FD MYFILE
FLD1 10A
FLD2 5 0
FLD3 8 2
In this example:
- MYFILE is the name of the file.
- FLD1 is a 10-character alphanumeric field.
- FLD2 is a 5-digit numeric field.
- FLD3 is an 8-digit numeric field with 2 decimal places.
Resources
For more detailed tutorials and examples, you can refer to the following resources:
- AS400 Tutorial – Compile DDS Database File: A YouTube video tutorial on how to use DDS to create a database file.
- AS400 Tutorial – Coding a Database File: Another YouTube video tutorial on coding a database file using DDS.
- IBM Documentation: IBM’s official documentation on DDS concepts and coding rules.
Would you like more detailed information on any specific aspect of DDS or additional examples?
Joining our course will be helpful.