1.10.7 Segment Definition - $segname.desc

$segname.desc defines the fields within a segment.$segname.desc only exist for databases with access type of neither GSAM nor MSDB defined inimsdbs.desc, $segname.desc is located under $ART_IMS_CONFIG/db/$dbname.

Table 1-31 $segname.desc

[imsdb]Field Type Value Description Source in SEGM
NAME X(1..8) Mandatory Field Name NAME
START Integer Mandatory Offset of the field, inside the segment, 0~length of segment - 4 START
BYTES Integer Mandatory Length of the field, 4~32760 BYTES
TYPE Enum Mandatory C: Alpha-Numeric string, requires conversion.

P: Packed Decimal, conversion not required.

X: Hexadecimal, requires conversion.

M: Mixed type, used when a FIELD contains different types of sub pieces. Requires conversion.

TYPE
FORMAT X(1...512) Optional Only needed (mandatory) for TYPE=M.

The configuration rule for this format is as follows: format=PIECE1- LEN,PIECE1-TYP E;PIECE2-LEN, PIECE2-TYPE;PIECE3-LEN, PIECE3-TYPE.

For example: format=3,P;4,C ;3,p.

Please note the following:

  1. The PIECE-TYPE must be C/P/X.
  2. Tailing - is not allowed.
  3. The format string must cover all bytes in the field.
N/A

The field’s type definition is not only from FIELD statement of DBD, user also needs to define the field’s type according to its usage in COBOL program.

If you do not define the type for a field, the default field type is C

The following table shows the Field Definition mapping table according to field usage in the COBOL program.

Table 1-32 Field Definition Mapping Table

COBOL Picture Description IMS Type
PIC X Alph-numeric character display C
PIC 9 Numeric display C
PIC S9 Signed numeric display C
PIC S9 COMP-3 Packed decimal P
PIC S9 COMP; PIC S9 COMP-4 Binary X

The conversation/translating rule is as follows:

  • Type C, requires ASCII/EBCDIC translation.
  • Type P, does not require translation. (Both ASCII/EBCDIC translation and endian translation are not done. This for COMP-3 data area.)
  • Type X, requires endian translation.

At the completion of a retrieval or ISRT call, the Key Feedback Area is returned from ODBA Proxy. We reserve one special FIELD whose name is FBAFIELD to convert Key Feedback Area in DB PCB.

A segment concatenated key is made up of the keys of each of its parents and its own key. Key formats are positioned left to right, starting with the key format of the root segment and following the hierarchic path.

This special FIELD(FBAFIELD) defined in $segment must defined the format of the concatenated key of the segment. The Key FeedBack Area will be converted according to the definition of this field for the segname.

The following listing shows an example definition in $segname.desc.

Listing Example Definition

[field]
NAME=FBAFIELD
START=0
BYTES=11
TYPE=M
FORMAT=5,P;6,C

START should be 0.

BYTES defines the total length of the KEY FeedBack Area, that is the concatenated key total length.

TYPE defines the concatenated key’s type. If the concatenated key has different type, the TYPE should be set to M.

FORMAT should define the concatenate. key format if the TYPE=M.

If the special FIELD(FBAFIELD) is not defined in $ segname.desc, the KEY FeedBack Area is converted as TYPE C by default for the segname.

Note:

For search key field in SSA, its field name must be the same as the Search KEY FIELD name defined in DBD and the name used in the SSA.