Skip to Content

It is common for hierarchical flat files to have a key field indicating the type of structure for the line. For the case of fixed length files, normally the value of the key field is same as the maximum length defined for the key field.

However, there are occasions where the value of the key field is shorter than the maximum defined length. Below is an example whereby the file has 3 different structures – Header, Line and Trailer. The maximum length of the key field is defined as 10, however the actual contents are only 6.

/wp-content/uploads/2014/08/filestruct_524379.png

This can cause potential issue during configuration and execution of content conversion for such file format. If the fieldFixedLengths parameter is set to 10 for the key field, and the keyFieldValue has length of 6 (i.e. MSGHDR); during runtime processing, it will not be able to match that line. Even if we try to pad the keyFieldValue with additional white space, these spaces are automatically removed during channel activation.

A simple technique can be employed in order to resolve this. It involves splitting the key field into two parts – an actual key field and a dummy field.

Using the example above, the key field is split into the following two fields:-

CORCID – length 6

TEMP – length 4

The corresponding data type in ESR should be modified to match this split of fields.

In the parameter configuration of the content conversion, the field split is reflected as below:-

xml.keyFieldName = CORCID

xml.Header.fieldFixedLengths = 6,4,<Other field lengths>

xml.Header.fieldNames = CORCID,TEMP,<Other fields>

xml.Header.keyFieldValue = MSGHDR

xml.Line.fieldFixedLengths = 6,4,<Other field lengths>

xml.Line.fieldNames = CORCID,TEMP,<Other fields>

xml.Line.keyFieldValue = MSGLIN

xml.Trailer.fieldFixedLengths = 6,4,<Other field lengths>

xml.Trailer.fieldNames = CORCID,TEMP,<Other fields>

xml.Trailer.keyFieldValue = MSGTRL

Below are screenshots of an example configuration based on the example. Please note that the example uses the MessageTransformBean module, but this splitting technique is also applicable for FCC configuration on the File/FTP adapter.

Module processing sequence

/wp-content/uploads/2014/08/module_524380.png

Module parameters

Set conversion class

/wp-content/uploads/2014/08/contenttype_524398.png

Set conversion type and document details

/wp-content/uploads/2014/08/mtbtop_524393.png

Set record structure

/wp-content/uploads/2014/08/mtbstruct_524394.png

Set field configuration for Header structure

/wp-content/uploads/2014/08/mtbhead_524395.png

Set field configuration for Line structure

/wp-content/uploads/2014/08/mtbline_524396.png

Set field configuration for Trailer structure

/wp-content/uploads/2014/08/mtbtrail_524397.png

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply