Your use of attributes in segment declarations for DML record-types depends on whether the record-type contains a CALC key, acts as a descendant segment, or contains an index.
The following attributes are common to all segment declarations:
SEGNAM=segname, RECORD=record, AREA=area
where:
If your record-type is a CALC record-type (contains a CALC key) include the two attributes below.
CLCFLD=clcfld, CLCDUP=clcdup
where:
Note: These attributes are required for all CALC record-types, regardless of how their parent/descendant relationships are implemented.
As discussed in IDMS Overview and Mapping Concepts, record-types are assigned parent/ descendant relationships. These relationships are based on sets and CALC or index fields. Consult your Master File to determine if a segment is a descendant or parent.
You can declare attributes for set-based segments as follows.
ACCESS=set, SETNAME=setname, SETMBR=setmbr, GETOWN={Y|N},
MULTMBR={Y|N}, KEYFLD=keyfld, SETORD={A|D}, SETDUP={Y|N}
where:
MA |
Set membership is mandatory/automatic. |
MM |
Set membership is mandatory/manual. |
OA |
Set membership is optional/automatic. |
OM |
Set membership is optional/manual. |
You can declare attributes for CALC-based segments as follows.
ACCESS=calc, KEYFLD=keyfld
You can declare attributes for index-based segments as follows.
ACCESS=ix, KEYFLD=keyfld, SETNAME=setname
where:
The ACCESS attribute indicates the relationship that exists between record-types. The value CLC or IX specifies an embedded cross-reference based on a CALC or indexed field. The value SET indicates a physical relationship based on a set of pointers.
For a sorted set, the KEYFLD value is the FOCUS field that sequences the set. Select a FOCUS field from a parent or descendant segment as the value of KEYFLD in the descendant segment declaration.
For CALC- and index-based relationships, the KEYFLD attribute provides the search value to read CALC and index fields in descendant segments. These search values are located in parent segment fields. Specify the parent field name for the value of KEYFLD in the descendant segment declaration.
The KEYFLD attribute is especially important when the two record-types in a parent/ descendant relationship are from different subschemas. The record-type that acts as the descendant segment is the entry point into the second subschema. It must have a CALC key (CLCFLD) or index set (SETNAME) with ACCESS=CLC or ACCESS=IX. The descendant segment declaration must also list the KEYFLD value from the parent segment in the first subschema.
For index-based relationships, the SETNAME value is the IDMS name of the index set. A corresponding index declaration is required (see Index Declarations for Network Record- Types for additional information).
If your record-type contains an indexed field, you may suppress area sweeps when the segment is used as a point of entry into the data source. To prevent area sweeps, specify the optional SEGFLD attribute in the segment declaration. Only those record instances connected to the specified index field are accessed.
SEQFIELD=seqfld
where:
This optional attribute requires an index declaration (see Index Declarations for Network Record-Types for more information).
This brief syntax example shows one subschema with two segments that are CALC record-types; the INVOICE record-type has a set-based relationship with the CUSTOMER record-type.
SSCHEMA=SAMPSSCH,RELEASE=14,$
SEGNAM=CUSTOMER,RECORD=CUSTOMER,AREA=CUSTOMER-REGION,
CLCFLD=CUST_NUMBER,CLCDUP=N,$
SEGNAM=INVOICE,RECORD=INVOICE,AREA=INVO-REGION,
CLCFLD=INV_NUMBER,CLCDUP=N,ACCESS=SET,
SETNAME=CUSTOMER-INVO,SETMBR=MA,GETOWN=Y,MULTMBR=N,$
The next example shows two subschemas. The INSURANCE-PLAN record-type has a CALC-based relationship with the COVERAGE record-type.
SSCHEMA=EMPSS01,RELEASE=14,$
SEGNAM=COVERAGE,RECORD=COVERAGE,AREA=INS-DEMO-REGION,$
SSCHEMA=EMPSS03,RELEASE=14,$
SEGNAM=INSURNCE,RECORD=INSURANCE-PLAN,
AREA=INS-DEMO-REGION,CLCFLD=INS_PLAN_CODE,CLCDUP=N,
ACCESS=CLC,KEYFLD=COV_CODE,$
Information Builders |