About fixed length or 'positional' data

Fixed length or positional data are simple collections of records where each record has a known length.  For example, the lastName field could contain the characters found between the 1 and the 16 character positions, as shown in Figure 1:

Figure 1. Positional or Fixed Length Data example where a limited number of cells or boxes is allocated to each category, in this example: lastName, firstName, and customerID.
As shown in Figure 1, delimiters are not used to separate the characters between the following fields:
  • lastName
  • firstName
  • customerID

For this example, the end-of-line delimiter is used to separate the data in the first and second records. You can define a Flat File Schema for a mix of positional and delimited data.

All data in the record is required because omitting the data would change the position of subsequent fields. If data is not available, spaces or zeros are added to pad out the field lengths as shown for the nickname and age fields in the following figure:

Figure 2. Padding using spaces or zeros

In the second line of data in the previous figure, no name is specified in for the nickname field - instead, there are spaces to pad out the missing nickname, so the string: Halden is correctly parsed as a last name. In addition, an extra zero was added to the front of the ages because the age field is three characters but the ages 12 and 91 are only two characters long.

Fields and records can repeat, but the number of repletions must be predefined in Studio and each record must have the same number of fields. For example, if you specified that the number of occurrences of the nickname field was equal to two, each record in the field must specify two nicknames or add spaces to pad for the missing nickname as shown in the following figure:

Figure 3. Padding with spaces

For an example of parsing positional data, see the originNode of the Mixed positional and delimited example.




Feedback | Notices


Timestamp icon Last updated: Wednesday, February 17, 2016


http://pic.dhe.ibm.com/infocenter/wci/v7r0m0/topic/com.ibm.wci.doc/about_fixed_length_or_positional_data.html