DLISegment stereotype

The DLISegment stereotype specializes a Record part for use with a hierarchical database.

Each segment type that you want to access in a DL/I database must have an equivalent DLISegment record in your program.

Consider a database that holds customer information. For each customer, there are segments for credit status, history, and individual locations. Each location has order segments, and each order has item segments. For a diagram and code for this example, see the related concepts at the end of this topic.

To access this database from an EGL program, create DLISegment type records for Customer, Credit, History, Location, Order, and Item.

The structure of fields within the DLISegment record must match the structure of the segment as DL/I presents it to your program:
The following is an example of a DLISegment record:
Record CustomerRecordPart type DLISegment 
{ segmentName="STSCCST", keyItem="customerNo" }
	10 customerNo char(6)      { dliFieldName = "STQCCNO" };  //key field
	10 customerName char(25)   { dliFieldName = "STUCCNM" };
	10 customerAddr1 char(25)  { dliFieldName = "STQCCA1" };
	10 customerAddr2 char(25)  { dliFieldName = "STQCCA2" };
	10 customerAddr3 char(25)  { dliFieldName = "STQCCA3" };
end

Feedback