Description

The FixedFileSegmentMergeReceiver merges the data from two or more segmented data files using the SegmentDataCreatorReceiver, into one or more Fixed file formatted output files.


Parameters

The FixedFileSegmentMergeReceiver requires that the following parameters are defined. Items with an asterisk* are required.

  • outputPath* - Defines the location to store the newly generated nested Fixed text file(s).
  • outputSubDirectory* - Defines the prefix name of subdirectories that are auto created under the outputPath and then appended with a number.
  • configName* - Defines the name of the configuration file.
  • configPath *- Defines the location where the configuration file to be stored.
  • configSubDir - Defines the subdirectory under the configPath directory where the configuration file to be stored.
  • segmentPath* - Defines the path to the Segment directory where all segment subdirectories can be found.
  • segmentSubDirectory* - Defines the subdirectory under the segmentPath where segment files can be found.
  • overrideFileName - Defines the fileName which will override the fileName provided in the configuration file.
  • filesPerOutputSubDir* - Defines the number of files to be generated per output subdirectory.
  • deleteOutputSubDir - Defines whether to delete the generated or an existing outputSubDirectory or not during the execution of the Scenario.
  • sequenceNumberPlaceholder - Defines the placeholder for the Sequence number, which will be replaced while creating the fixed file. 
  • sequenceNumberLeftPadValue - Defines the pad Value for the sequence number.
  • rowCountLeftPadValue - Defines the pad Value for the row count in the last row. Use GR_ROW_COUNT constant in your Attribute's Generator, to be replaced with row count in the generated file with optional Pad value. 


Receiver Attribute Property Keys

There are no property keys necessary for this Receiver.


Example Transaction Story

In this use case, the user wants to generate five transaction records per day. So, the five transaction records will be generated for each record header which will be followed by a record trailer.


So, the following example is based on the generation of segmented data for three Domains.  There are three Domains the represent that following hierarchy in parent-child relationships:

  • FileHeaderDomain is the root Domain
  • TransactionRecordDomain is a child of the FileHeaderDomain
  • FileTrailerDomain is a child of the FileHeaderDomain


Each Domain will use a SegmentCreatorReceiver to generate segmented data output with referential integrity with regards to parent-child relationships. The last Domain, Merge, will also use a FixedFileSegmentMergeReceiver to merge the segmented data generated for each Domain into one or more nested Fixed text output files. Four Scenarios will be created out of which three Scenarios (having SegmentDataCreatorReceiver) will be containing the instruction on how much-segmented data to generate for each Domain and the last Scenario will merge the segments together to generate the output. Lastly, the Scenarios can be chained together so that they can be run with one command instead of four separate commands.



Configuration File

The configuration file defines the following elements of information:

  1. fileNameSegments - contains sub-elements that define how file names are created for each delimiter file generated.

  2. segmentFiles - contains sub-elements that define the file names of the segment data files to merge.

  3. elements - contains nested subelements that define the format of the Fixed text output.


Steps to Create Configuration File

  • Select the Configuration Management tab from the Management pane.

  • Click on the New Configuration button.

  • Select Fixed Format radio button in the Select Configuration Type.

  • Enter the required parameters to create a configuration file.
    • Name: Defines the unique name for the Fixed File configuration.
    • Config File Name: Defines the name of the configuration file that FixedFileSegmentMergeReceiver will read to create a Fixed File format file.
    • Output File Name Format: Defines the format for the name of the output file.
    • Definitions: Defines the various segment and template files that will be used to build nested XML.


  • Arrange the Segments in a hierarchy by drag/drop the segments.


Now Configuration files are ready to be downloaded.


Example Configuration File

This sample configuration file is defined to allow three-segment files to be merged into one or more Fixed nested output files.  The format of the segmented data must produce nested output which meets the following rules:

  • There must be one fileHeader record to be generated in the Fixed-format text file.
  • Each fileHeader must have five transaction records
  • Each fileHeader must have one fileTrailer  


The XML configuration file

The following is a preview of the XML configuration file which will produce the Fixed file formatted output files based on the settings provided in the configuration file.


<Config>
  <fileNameSegments>
    <fileNameSegment segmentType='Constant' value='FixedFile-' />
    <fileNameSegment segmentType='Counter' value='1' />
    <fileNameSegment segmentType='Constant' value='.txt' />
  </fileNameSegments>
  <segments>
    <segment domainName='FileTrailer' templateFile='FileTrailerTemplate.xml' segmentFile='FileTrailerSegment.xml' />
    <segment domainName='TransactionRecord' templateFile='TransactionRecordTemplate.xml' segmentFile='TransactionRecordSegment.xml' />
    <segment domainName='FileHeader' templateFile='FileHeaderTemplate.xml' segmentFile='FileHeaderSegment.xml' />
  </segments>
  <segmentHierarchy>
    <segment domainName='FileHeader'>
      <segment domainName='TransactionRecord' />
      <segment domainName='FileTrailer' />
    </segment>
  </segmentHierarchy>
</Config>


The example configuration file defines the following information.


FileNameSegments

The subelements will produce a file naming convention that looks like the following:

  • FixedFile-1.txt


TemplateFiles

The following template files will be loaded and used to create the XML output when merged with segment data.

  • FileHeaderTemplate.xml
  • TransactionRecordTemplate.xml
  • FileTrailerTemplate.xml


SegmentFiles

The following segment files will be loaded and their data used in the merge process.

  • FileHeaderSegment.xml

  • TransactionRecordSegment.xml

  • FileTrailerSegment.xml


Elements

The elements and subelements are configured to produce the following nested Fixed structure.


File Header Record
Detail Entry Record 1
Detail Entry Record 2
Detail Entry Record 3
Detail Entry Record 4
......
File Trailer Record


Template Files

Each template file below represents a block of XML elements used for merging with segment data that, combined together, will create a nested Fixed file.


FileHeader Template

This template will be used for data segment merging with <segment name="FileHeader">

<Segment name='FileHeader'>
  <attributes>
    <attribute fieldName='recordType' length='2' />
    <attribute fieldName='fileId' length='6' />
    <attribute fieldName='fileIdSeparator' length='2' />
    <attribute fieldName='fileIdValue' length='12' />
    <attribute fieldName='filler' length='12' />
  </attributes>
</Segment>


TransactionRecord Template

This template will be used for data segment merging with <segment name="TransactionRecord">


<Segment name='TransactionRecord'>
  <attributes>
    <attribute fieldName='recordType' length='2' />
    <attribute fieldName='customerNumber' length='10' />
    <attribute fieldName='customerAccountNumber' length='12' />
    <attribute fieldName='transactionId' length='36' />
    <attribute fieldName='transDate' length='12' />
    <attribute fieldName='cardNumFirst6' length='7' />
    <attribute fieldName='totalTransAmt' length='12' />
  </attributes>
</Segment>


FileTrailer Template

This template will be used for data segment merging with <segment name="FileTrailer">


<Segment name='FileTrailer'>
  <attributes>
    <attribute fieldName='recordType' length='2' />
    <attribute fieldName='institutionName' length='12' />
    <attribute fieldName='institutionID' length='8' />
    <attribute fieldName='filler' length='12' />
  </attributes>
</Segment>


Example Files

All of the example files below were generated by GenRocket.


Example merged nested Fixed file

The following is an example of a merged Fixed file for the first fileHeader generated.


HHFILEID||2020-01-15  000000      
DT58915105  2971808990189c020401-ee58-11e7-8759-32f3b4cfdcfe2021-02-27  511000 22887       
DT26453620  8151292560139c020402-ee58-11e7-8791-2d31158ecac92021-06-10  521000 36419       
DT74251185  5750372101049c020403-ee58-11e7-a43d-452e38f253df2021-02-25  531000 89945       
DT96446123  1271129203009c020404-ee58-11e7-a4c2-a1cbe8b9e27e2021-11-12  541000 34513       
DT57987204  6495833593529c020405-ee58-11e7-a8a8-9c534bdd8ad62021-02-01  551000 52712       
TTGenRocket   GNRCKT  000000      


Example Segment Files

The following are four example segmented data files used to generate the merged nested Fixed files.


FileHeaderSegment.xml 

This file will contain one segment having one data element containing the fileHeader attributes, a loopCount equal to one and no parentId since the fileHeader is the root Domain and does not have a parent Domain.


<segments>
  <segment id="1" setId="1">
    <attribute name="recordType"><![CDATA[HH]]></attribute>
    <attribute name="fileId"><![CDATA[FILEID]]></attribute>
    <attribute name="fileIdSeparator"><![CDATA[||]]></attribute>
    <attribute name="fileIdValue"><![CDATA[2020-01-15]]></attribute>
    <attribute name="filler"><![CDATA[000000]]></attribute>
  </segment>
</segments>


TransactionRecordSegment.xml

This file will contain ten segments each having seven data elements containing the userRecord attributes, a loopCount equal to five and a parentId given each set of users referential integrity to a given fileHeader defined within FileHeaderSegment.xml.


<segments>
  <segment id="1" setId="1">
    <attribute name="recordType"><![CDATA[DT]]></attribute>
    <attribute name="customerNumber"><![CDATA[58915105]]></attribute>
    <attribute name="customerAccountNumber"><![CDATA[297180899018]]></attribute>
    <attribute name="transactionId"><![CDATA[9c020401-ee58-11e7-8759-32f3b4cfdcfe]]></attribute>
    <attribute name="transDate"><![CDATA[2021-02-27]]></attribute>
    <attribute name="cardNumFirst6"><![CDATA[511000]]></attribute>
    <attribute name="totalTransAmt"><![CDATA[22887]]></attribute>
    <attribute name="fileHeader"><![CDATA[1]]></attribute>
  </segment>
  <segment id="2" setId="1">
    <attribute name="recordType"><![CDATA[DT]]></attribute>
    <attribute name="customerNumber"><![CDATA[26453620]]></attribute>
    <attribute name="customerAccountNumber"><![CDATA[815129256013]]></attribute>
    <attribute name="transactionId"><![CDATA[9c020402-ee58-11e7-8791-2d31158ecac9]]></attribute>
    <attribute name="transDate"><![CDATA[2021-06-10]]></attribute>
    <attribute name="cardNumFirst6"><![CDATA[521000]]></attribute>
    <attribute name="totalTransAmt"><![CDATA[36419]]></attribute>
    <attribute name="fileHeader"><![CDATA[1]]></attribute>
  </segment>
  <segment id="3" setId="1">
    <attribute name="recordType"><![CDATA[DT]]></attribute>
    <attribute name="customerNumber"><![CDATA[74251185]]></attribute>
    <attribute name="customerAccountNumber"><![CDATA[575037210104]]></attribute>
    <attribute name="transactionId"><![CDATA[9c020403-ee58-11e7-a43d-452e38f253df]]></attribute>
    <attribute name="transDate"><![CDATA[2021-02-25]]></attribute>
    <attribute name="cardNumFirst6"><![CDATA[531000]]></attribute>
    <attribute name="totalTransAmt"><![CDATA[89945]]></attribute>
    <attribute name="fileHeader"><![CDATA[1]]></attribute>
  </segment>
  <segment id="4" setId="1">
    <attribute name="recordType"><![CDATA[DT]]></attribute>
    <attribute name="customerNumber"><![CDATA[96446123]]></attribute>
    <attribute name="customerAccountNumber"><![CDATA[127112920300]]></attribute>
    <attribute name="transactionId"><![CDATA[9c020404-ee58-11e7-a4c2-a1cbe8b9e27e]]></attribute>
    <attribute name="transDate"><![CDATA[2021-11-12]]></attribute>
    <attribute name="cardNumFirst6"><![CDATA[541000]]></attribute>
    <attribute name="totalTransAmt"><![CDATA[34513]]></attribute>
    <attribute name="fileHeader"><![CDATA[1]]></attribute>
  </segment>
  <segment id="5" setId="1">
    <attribute name="recordType"><![CDATA[DT]]></attribute>
    <attribute name="customerNumber"><![CDATA[57987204]]></attribute>
    <attribute name="customerAccountNumber"><![CDATA[649583359352]]></attribute>
    <attribute name="transactionId"><![CDATA[9c020405-ee58-11e7-a8a8-9c534bdd8ad6]]></attribute>
    <attribute name="transDate"><![CDATA[2021-02-01]]></attribute>
    <attribute name="cardNumFirst6"><![CDATA[551000]]></attribute>
    <attribute name="totalTransAmt"><![CDATA[52712]]></attribute>
    <attribute name="fileHeader"><![CDATA[1]]></attribute>
  </segment>
</segments>


FileTrailerSegment.xml

This file will contain one segment having one data element containing fileTrailer attributes, a loopCount equal to one and a parentId given each fileHeader referential integrity to a given fileHeader defined within FileHeaderSegment.xml.


<segments>
  <segment id="1" setId="1">
    <attribute name="recordType"><![CDATA[TT]]></attribute>
    <attribute name="institutionName"><![CDATA[GenRocket]]></attribute>
    <attribute name="institutionID"><![CDATA[GNRCKT]]></attribute>
    <attribute name="filler"><![CDATA[000000]]></attribute>
    <attribute name="fileTrailer"><![CDATA[1]]></attribute>
  </segment>
</segments>