FIELD statement

A FIELD statement defines the information about a given byte range within a segment.

Restriction: Only IMS™ fields can be used in an SSA. User-defined fields cannot be used in an SSA.

You can define up to 1000 fields for all segments in a DBD, and a maximum of 255 fields for any segment type. A unique sequence field is required for the root segment types of HISAM, HIDAM, PHIDAM, HIDAM primary INDEX, SHISAM, DEDB, and non-terminal-related MSDB databases.

Parameters

Field name (NAME)
Name of the IMS field within a segment type. The name specified can be referred to by an application program in a DL/I call SSA. Duplicate field names must not be defined for the same segment type. Field name must be a 1- to 8-alphanumeric character value. The first character of a field name can be a number, a letter, or a forward slash (/).
Alias (EXTERNALNAME)
External name of an IMS or user-defined field within a segment type. The alias can be referred to in Java™ applications to specify the fields that the application wants to query. Duplicate aliases must not be defined for the same segment type. Alias must be an alphanumeric character value, and cannot be an SQL keyword.
Starting position (START)
Starting position of the field in bytes relative to the beginning of the segment. The starting position must be a number from 1 - 32767. The starting position for the first byte of a segment is 1.
Length (BYTES)
Length of the field in the segment in bytes. Valid values are 1 - 255.
Sequence field (SEQ)
Identifies a field as a sequence field in the segment type.

In a DEDB, SEQ must be used in the root segment and can be specified in any direct dependent segment.

Restriction: SEQ cannot be specified for the sequential dependent segment.
M or U or None
M (Duplicate)
Duplicate values are allowed in the sequence field of occurrences of the segment type. Except for HDAM databases, for a root segment type, the sequence field of each occurrence must contain a unique value. The root segment type in an HDAM database does not need a key field; if a key field is defined, it does not need to be unique.
U (Unique)
Only unique values are allowed in the sequence field of occurrences of the segment type. For a dependent segment type, the sequence field of each occurrence under a given physical parent segment must contain a unique value.
None
Occurrences of the segment are inserted according to the rule of FIRST, LAST, or HERE, as specified on the SEGM or LCHILD statement for that segment.
Recommendation: Use unique sequence fields for all segments that participate in a logical relationship. This includes physical and logical parents and physical and logical child segments. Multiple sequence fields for a virtual logical child segment type must be uniformly defined as either unique or nonunique.

In a non-terminal-related MSDB without terminal-related keys, unique (U) values must be specified for the root sequence field. In a DEDB, unique (U) values must be specified for the sequence field of the root segment. A dependent segment in a DEDB does not require a key. However, if a key is defined, it must be unique.

IMS data type (TYPE)
Type of data to be contained in this field:
X
Hexadecimal data.
P
Packed decimal data.
C
Alphanumeric data or a combination of types of data. When C is specified, if IMS needs to fill unused bytes in the field, IMS left-aligns the value and fills the unused bytes to the right of the value with blank characters (X'40').
F
Binary fullword data. Valid only for MSDB databases.
H
Binary halfword data. Valid only for MSDB databases.

All DL/I calls perform field comparisons on a byte-by-byte binary basis. IMS does not ensure that the data in a field is of the type specified by this parameter, except when the defined field is used with field sensitivity or is in an MSDB.

Types X, C, P, H, and F are valid in an MSDB, with the following rules applying:

  • Only a C or X field can contain another field.
  • A single field can have multiple definitions if no more than one definition is arithmetic (types P, H, and F).
  • If a field contains any part of an arithmetic field, it must contain the entire field.
  • The sequence field must be TYPE=C or X.
  • The sequence field cannot be part of any other field.
  • SSA and FSA comparisons of arithmetic fields use arithmetic rather than logical compare operations.
  • Initial loading and call processing routines test for valid digits and X and P type fields.
  • The following rules apply to the MSDB field length:
    • TYPE=X: BYTES=1 to 256
    • TYPE=C: BYTES=1 to 256
    • TYPE=P: BYTES=1 to 16
    • TYPE=H: BYTES=2
    • TYPE=F: BYTES=4
    • Field types F and H must have explicit length specifications.
    • Fields must be aligned on appropriate boundaries for performance optimization if they are involved in compare or arithmetic operations and are a fullword or a halfword. The beginning of the segment is aligned on a fullword boundary.
Map name (NAME)
Identifies the map that the map case references for fields that are identified as part of a map case.
Case name (NAME)
Identifies the map case that this field is contained in.
Remarks
1- to 256- characters of text that is added to the generated metadata as comments. Enclose comments that include special characters, commas, or blank spaces in single quotation marks.

Redefines field group

A field can be redefined as one or more fields, as long as the total length of the fields in the redefinition does not exceed the length of the segment.

If you are redefining a field as multiple fields, specify structure or array as the data type to contain the multiple fields of the redefinition.

You cannot redefine a field that specifies a dynamic array or a field that contains a dynamic array as the data type.

Redefines field
The field that redefines another field. To specify this field, add or edit the field being redefined in the Add or Edit Fields wizard, and specify this field in the Redefines field field.
Redefined field
The field that is being redefined. To specify this field, add or edit the field in the Add or Edit Fields wizard, and specify the field that you would like to redefine it in the Redefines field field.




© Copyright IBM Corporation 2010, 2017.