Non-delimited data

A file is considered 'truly flat' when there are no delimiters and the fields are fixed width. In this case, the max-length attribute on the field element is used to specify the length of each field.

In fixed length data, it is often necessary to pad the data values in order to guarantee that the fields begin in the correct position. This is handled using the trailing-chars attribute. This attribute defines the characters that may appear after the actual data and which will automatically be stripped from the data before it is written to XML. In addition, the FSD processor uses the trainling-chars attribute to determine a suitable filler character when the data is being converted from XML back to flat format.

This is an example of an FSD that uses fixed length fields:

<?xml encoding='UTF-8' version='1.0' ?>
<schema xmlns='http://www.infor.com/2017/TD/SSTransform/fsd/' version='1.0'>
  <sequence output='no'>
    <record max-occur='0' name='parent'>
      <field name='child1' max-length='20' trailing-chars=' '/>
      <field name='child2' max-length='20' trailing-chars=' '/>
    </record>
  </sequence>
</schema>

This is an example of some input data for this FSD:

Child Data 1
Child Data 2
Child Data 3
Child Data 4

and output data for this FSD:

<parent>
  <child1>Child 1 Data</child1>
  <child2>Child 2 Data</child2>
</parent>
<parent>
  <child1>Child 3 Data</child1>
  <child2>Child 4 Data></child>
</parent>