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.
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