Introduction to data parts

Data parts define a structure that stores one or more pieces of data. Data parts form the basis for a variable that you can use in a logic part.
EGL offers the following types of data parts:
ArrayDictionary
When you use a variable that is based on an ArrayDictionary part, you can access a series of arrays by retrieving the same-numbered element of every array. A set of elements that is retrieved in this way is itself a dictionary, with each array name treated as a key that is paired with the value in the array element.
DataItem
A DataItem part specializes a primitive data type by assigning it a name and limiting the values that can be assigned to it. When you define a DataItem part, you do not reserve storage; you reserve storage only when you declare a variable based on that DataItem part.
DataTable
A DataTable part provides a collection of data in tabular form that you can provide throughout an application. DataTables are main parts.
Dictionary
A dictionary contains fields to which you can assign values. It is not associated with a database, and you can add new fields (called name/value pairs) while your program is running. You create a dictionary type variable to reserve storage. The amount of storage the dictionary uses will change depending on the information that you put in the dictionary.
Form
A Form part contains information about how the layout and characteristics of a set of fields are displayed to the user. Form parts can display information on either a printer (print form) or a 3270 screen or console window (text form). You cannot generate a Form part outside of a FormGroup part.
FormGroup
A FormGroup part defines the text and print forms within the FormGroup source file, includes Form parts by using the use declaration, and can define floating areas. FormGroup parts are main parts.
primitives
EGL supplies simple data types similar to those found in most other programming languages, such as numbers, dates, characters, and large objects. Primitives form the basis for more complex data types. Here are two examples of variables created from primitives:
myInteger INT;
myString CHAR(50);

You can find a complete list of primitives in Primitive data types. See Commonly used primitives for the primitives you are most likely to work with.

records
Record parts are structured collections of other data parts, such as primitives, DataItems, or other records. These other data parts within the record part are referred to as its fields. Generally, a record part represents a table in a database, with one field for each column in the table:
Record myCustomerRecord type BasicRecord
    customerNumber     INT;
    customerFirstName  STRING;
    customerLastName   STRING;
    customerBalance    FLOAT;
end
This record has four fields: one integer, two strings, and one floating-point number. These fields could just as easily be dataItems or other records.
Strictly speaking, the data part itself doesn't store data; a variable created from that data part stores the data. In this way, you can think of a data part as a pattern for a variable. You can declare a variable simply by naming the variable and then specifying the data part that you want to use:
myVariable1 INT;
myVariable2 myDataItemPart;
myVariable3 myRecordPart;

Feedback