DEFINING AN EXTRACT
To define an extract, you must first declare the individual records and then define their structure.
Declaring Extract Records as Field Groups
An extract dataset consists of a sequence of records. These records may have different structures. All records with the same structure form a record type. You must define each record type of an extract dataset as a field group, using the FIELD-GROUPS statement.
FIELD-GROUPS
This statement defines a field group
A field group does not reserve storage space for the fields, but contains pointers to existing fields. When filling the extract dataset with records, these pointers determine the contents of the stored records.
You can also define a special field group called HEADER:
FIELD-GROUPS HEADER.
This group is automatically placed before any other field groups when you fill the extract. This means that a record of a field group
Defining the Structure of a Field Group
To define the structure of a record, use the following statement to add the required fields to a field group:
INSERT
This statement defines the fields of field group
The INSERT statement, just as the FIELD-GROUPS statement, neither reserves storage space nor transfers values. You use the INSERT statement to create pointers to the fields
When you run the program, you can assign fields to a field group up to the point when you use this field group for the first time to fill an extract record. From this point on, the structure of the record is fixed and may no longer be changed. In short, as long as you have not used a field group yet, you can still extend it dynamically.
The special field group HEADER is part of every extract record. Consequently, you may not change HEADER once you have filled the first extract record.
A field may occur in several field groups; however, this means unnecessary data redundancy within the extract dataset. You do not need to define the structure of a field group explicitly with INSERT. If the field group HEADER is defined, an undefined field group consists implicitly of the fields in HEADER, otherwise, it is empty.
NODES: SPFLI, SFLIGHT.
FIELD-GROUPS: HEADER, FLIGHT_INFO, FLIGHT_DATE.
INSERT: SPFLI-CARRID SPFLI-CONNID SFLIGHT-FLDATE INTO HEADER,SPFLI-CITYFROM SPFLI-CITYTO INTO FLIGHT_INFO.
There are three field groups. The INSERT statement assigns fields to two of the field groups.

No comments:
Post a Comment