Skip to main content

File Masking Record Types - Headers, Trailers, and Filters (KBA7064)




KBA# 7064


At a Glance

Description: The Continuous Compliance Engine can mask Files using different file formats (different fields and algorithm configuration) in the same file by using Record Types.  

This page describes how to define record types for file masking including header, trailer, and multiple bodies with filters for delimited and fixed files. 
How To: The Workflow for Defining Record Types are: 
  1. Define File Format (one for All Records and one per format).
  2. Create Rule Set and configure the File Format:
    • Set the All Records - File Format.
    • Set the EOR, delimiter (if applicable), and enclosure.
  3. Define Inventory - where applicable: 
    • Define the Record TypeHeader/Trailer
    • Define the Record Type - Body and assign file format and RegEx conditions.
Multiple RTs: Records Types (RT) conditions can be defined on 1 to 3 fields.
RT RegEx: Record Type filter conditions are defined on the value in the specified field - matched using RegEx.

Applicable Delphix Versions

Click here to view the versions of the Delphix engine to which this article applies
Major Release All Sub Releases




5.0,,,,,,,,, ,,,,,


4.2,,,,,,, ,,


Record Type Configurations

The first step is to create Masking Connectors for file masking. File masking is best configured as an On-The-Fly job as this job type is faster (shortest runtime) and it provides a better workflow.

Step 1 - Create File Format Files

This article covers three different file types. To define the file format, the first step is to create the file format in a text editor.

Example of Delimited and Fixed Width

Below are two examples of delimited and fixed width file formats (consult the IBM documentation for Copybook as it is too complex for a quick sample). 

Delimited - File Format example


Fixed Width - File Format example

Special Characters

There are some characters that are invalid when creating the file format - these are: 


All Records - File Formats

The file format for all records is the default file format for the file.



If none of the records in the default File Format should be masked (it is the pass-through) - then this File Format could just be one field. This makes the UI easier to read. 

For example, call the 'All Recs Not Masked'.

Multiple File Formats

If multiple record types are to be used (the masked rows need to be filtered), you then need to create one file format for each additional record type.



The field structure can be different per Record Type (i.e. RT1 can have 5 fields while RT2 has 9 fields).


It is recommended to name each file format so it is easy to see the record type (RT) and column name. The column names should also match the actual field name.

The example below is for a delimited file: 

  • RT1_Description1.txt
  • RT2_Description2.txt

Step 2 - Import the File Format

The second step is to Import and create the default file format. This is only done on the main (default) file format which will be called All Records (all additional file formats are added in the inventory). 

  1. Navigate to Settings > File Format, and then click Import File Format.
  2. Select Import Format Type.
  3. Import fields by clicking Select, and then select the default File Format.
  4. Save the setting.

Step 3 - Create Rule Set

When you create the Rule Set, set the format details (delimiter, EOR, and Enclosed character if used). This will be the default record type called All Records.



To set the EOR Special Characters - click CTRL. For details please see KBA8928 (link above).


Step 4 - Define Inventory

To define record types in the user interface: 

  1. Navigate to EnvironmentInventory and click Record Types.

Define Header

If applicable, define the Header (predefined unmasked rows at the top of the file). 

  • Click  + Add a Record Type.
  • Define the Header details:
    • Name the Record Type.
    • For the Header/Body/Trailer - select Header.
    • Define the number of rows (the first n rows will be ignored when masking).

Define Trailer

If applicable, define the Trailer (predefined unmasked rows at the top of the file).

  • Click + Add a Record Type.
  • Define the Header details:
    • Name the Record Type.
    • For the 'Header/Body/Trailer' - select Trailer.
    • Define the number of rows (the last n rows will be ignored when masking).

Define Body (File Format)

For each File Format:

  • Click + Add a Record Type.
  • Define the Body details:
    • Name the Record Type.
    • For the Header/Body/Trailer - select Body.
    • # of identifier fields - this is how many fields should be used in the filter value (1, 2, or 3 fields)
    • Import Fields - Import the file format for this record type - select the specific file created above.
    • Define the ID #n Regular Expression and Position #
      • Depending on Id fields (1, 2, or 3 above there will be 1, 2, or 3 fields to fill in).
      • Define the RegEx matching the values in this field (if exact then write this value).
      • Detail which field Position # contains the record type identifier.


Record Type and Regular Expression
The regular expression (RegEx) is used to say mask the file format using the same algorithms.
If for example, these record types are to be masked (N1, N2, N3, ...) and they all had the same file format, you could use RegEx to create just one record type.

For example, the RegEx would be:


The configuration would be:

  • Record type: Header (1 row)
  • Record type Nx 
    • # of identifier fields = 1
    • ID #1 Regular Expression = N[0-9]
    • Position # = 1

Input file:


Masked file:


Errors and Resolution 

Masking job becomes unresponsive

The masking job will likely become unresponsive if there is no All Records. The masking job will read the data and for records that do not match any record type the engine will buffer these until the buffer is full, and then stop responding.


Make sure to create a default All Records file format and do not define any filter on this record type.

Masked file has additional Fields

If the file format for a row is defined to have 4 fields and the input only has 3 fields - the engine will create a row with all 4 fields and set the last field to NULL (empty).

The file format is an absolute definition of the row, and the engine will use the file format as a specification for how many rows to create in the masked output. 



Related Articles 

The following articles may provide more information or related information to this article: