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:
Is the corresponding Master File segment name of a DML record-type.
Is the IDMS record-type name.
Is the IDMS area name that contains the record-type.
If your record-type is a CALC record-type (contains a CALC key) include the following two attributes.
CLCFLD=clcfld, CLCDUP=clcdup
where:
Is the Master File field name of the CALC field.
Is Y or N, depending on whether the CALC field allows duplicates.
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:
Identifies the set-based relationship. Required for descendants.
Is the name of the set relating the segment to its parent.
Can be one of the following:
MA |
Set membership is mandatory/automatic. |
MM |
Set membership is mandatory/manual. |
OA |
Set membership is optional/automatic. |
OM |
Set membership is optional/manual. |
This information is used to verify set membership at execution time. To determine the appropriate value, check the set label on your Entity Relationship diagram.
Allows or inhibits GET OWNER calls, which obtain the owner records from a member record-type.
If the value is Y, the adapter issues GET OWNER calls to retrieve the owner record in the set when SEGTYPE is U, KLU, or when an S or KL segment is inverted (the parent/descendant relationship is reversed).
If the value is N, GET OWNER calls are inhibited. Specify N only when the set has no owner pointers. When GET OWNER calls are inhibited, the owner record-type cannot be a descendant of its member. In other words, if GET OWNER calls are inhibited, SEGTYPE cannot be U or KLU and, for certain segments in inversions, record retrieval will fail.
Y indicates that the set in which this record-type participates contains more than one member record-type.
Is the field name or alias of the sequencing field for the set. If the key is composed of multiple fields, separate the individual field names or aliases with slashes. Required for sorted sets.
A indicates ascending, D indicates descending for sorted set sequence. This attribute is required.
Is Y if duplicates are allowed, N if not. Required for sorted sets.
You can declare attributes for CALC-based segments as follows.
ACCESS=CLC, KEYFLD=keyfld
Identifies the CALC-based relationship. Required for descendants.
Is the field name or alias from the parent segment. If the key is composed of multiple fields, separate the individual field names or aliases with slashes.
You can declare attributes for index-based segments as follows.
ACCESS=IX, KEYFLD=keyfld, SETNAME=setname
where:
Identifies the index-based segment. Required for descendants.
Is the field name or alias from the parent segment. If the key is composed of multiple fields, separate the individual field names or aliases with slashes.
Is the set name of the IDMS index set.
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 SEQFLD attribute in the segment declaration. Only those record instances connected to the specified index field are accessed.
SEQFIELD=seqfld
where:
Is the FOCUS field name (FIELDTYPE=I) of the index.
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 |