Segment Attributes for Network Record-Types

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.


Top of page

Syntax: How to Specify Segment Attributes for Network Record-Types

The following attributes are common to all segment declarations:

SEGNAM=segname, RECORD=record, AREA=area

where:

segname
Is the corresponding Master File segment name of a DML record-type.

record
Is the IDMS record-type name.

area
Is the IDMS area name that contains the record-type.


Top of page

Syntax: How to Specify Segment Attributes for CALC Record-Types

If your record-type is a CALC record-type (contains a CALC key) include the two attributes below.

CLCFLD=clcfld, CLCDUP=clcdup

where:

clcfld
Is the Master File field name of the CALC field.

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


Top of page

Syntax: How to Specify Attributes for Set-Based Segments

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:

set
Is the set-based relationship. Required for descendants.

setname
Is the name of the set relating segment to its parent.

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

GETOWN={Y|N}
Allows or inhibits GET OWNER calls, which obtain the owner records from a member record-type.

If the value is Y, the data 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.

MULTMBR={Y|N}
Y indicates that the set in which this record-type participates contains more than one member record-type.

keyfld
Is the 1- to 12-character 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.

SETORD={A|D}
A indicates ascending, D indicates descending for sorted set sequence; required.

SETDUP={Y|N}
Is Y if duplicates are allowed, N if not. Required for sorted sets.


Top of page

Syntax: How to Specify Attributes for CALC-Based Segments

You can declare attributes for CALC-based segments as follows.

ACCESS=calc, KEYFLD=keyfld
calc
Is the CALC-based relationship. Required for descendants.

keyfld
Is the 1- to 12-character 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.


Top of page

Syntax: How to Specify Attributes for Index-Based Segments

You can declare attributes for index-based segments as follows.

ACCESS=ix, KEYFLD=keyfld, SETNAME=setname

where:

ix
Is the index-based segment. Required for descendants.

keyfld
Is the 1- to 12-character 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.

setname
Is the set name of the IDMS index set.


Top of page

Reference: Usage Notes for Access File Attributes

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


Top of page

Syntax: How to Suppress Area Sweeps

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:

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


Top of page

Example: Describing CALC-Based Record Types

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