Field Section

The final section of the XFD is the field section. This is the longest section of the file, because it describes all of the fields contained in the data file.

The file begins with a line describing the number of elementary fields defined for inclusion in the XFD (four digits), the total number of elementary fields in the file (five digits), the number of group and elementary fields listed in the FD (five digits), and the total number of group and elementary fields listed in the FD (five digits).

These last two items — the number and total number of group and elementary fields — may be different if the FD contains an OCCURS clause. Although the total number is increased by the number of times the item OCCURS, the item still has only one listing in the field section of the XFD. Total number is also affected by redefines, group items, and multiple FD descriptions, but it excludes filler fields.

Following the summary line, the field section contains a line for each field definition, listing:

When a field uses the OCCURS phrase, two special entries appear in the list of field definitions. These entries are designated by offsets of 90001 and 90002. The START-OCCURS entry is defined as follows:

90001,num-occurs,size,START-OCCURS

The END-OCCURS entry is defined as follows:

90002,END-OCCURS

The fields contained in the OCCURS clause are listed between these markers using normal field notation.

Fields that are not defined for actual use but that occur in the FD are indicated by the special condition marker 999.

A simple text field section would appear as follows:

# [Field Section]
0010,00010,00011,00011
0000000000,0000000197,16,0000000197,+00,000,999,01,CLIENT-RECORD
0000000000,0000000005,01,0000000005,+00,000,000,05,CL-CLIENT-ID
0000000005,0000000015,16,0000000015,+00,000,000,05,CL-FIRST-NAME
0000000020,0000000015,16,0000000015,+00,000,000,05,CL-LAST-NAME
0000000035,0000000040,16,0000000040,+00,000,000,05,CL-STREET-ADDR
0000000075,0000000030,16,0000000030,+00,000,000,05,CL-CITY
0000000105,0000000020,16,0000000020,+00,000,000,05,CL-STATE-PROV
0000000125,0000000006,16,0000000006,+00,000,000,05,CL-POST-CODE
0000000131,0000000013,16,0000000013,+00,000,000,05,CL-COUNTRY
0000000144,0000000013,16,0000000013,+00,000,000,05,CL-TEL
0000000157,0000000040,16,0000000040,+00,000,000,05,CL-EMAIL

In an XML-format XFD, the field section description appears as follows:

  <xfd:fields
    xfd:elementary-items="10"
    xfd:elementary-items-with-occurs="10"
    xfd:total-items="11"
    xfd:total-items-with-occurs="11">
    <xfd:field
      xfd:field-offset="0"
      xfd:field-bytes="197"
      xfd:field-type="16"
      xfd:field-length="197"
      xfd:field-scale="0"
      xfd:field-user-flags="0"
      xfd:field-condition="999"
      xfd:field-level="1"
      xfd:field-name="CLIENT-RECORD"
    />
    <xfd:field
      xfd:field-offset="0"
      xfd:field-bytes="5"
      xfd:field-type="1"
      xfd:field-length="5"
      xfd:field-scale="0"
      xfd:field-user-flags="0"
      xfd:field-condition="0"
      xfd:field-level="5"
      xfd:field-name="CL-CLIENT-ID"
    />
   .
   .
   .
  </xfd:fields>