This short explanation covers the mapping process that occurs when FILES are used in the masking process.
All supported TDM Mainframe components.
DB2 is different, however it will help to first review the process used by the DB2 side.
In both cases, the MAPCSV file may be thought of as a set of ‘requests’ to specify which fields/columns are to be masked, which masking functions(s) will be used, and to supply various runtime parameters to those functions. The major difference is in how the fields/columns specified are related to the information held in the input data source—file or table.
For DB2, the table and column names taken from the MAPCSV are combined with the schema name and used to create a dynamic SQL query that will execute and process the column. This only works because dynamic SQL interacts with the DB2 catalog at run time to achieve the required mapping.
With files, no such facility exists. Each file is different and the style and format of the COBOL copybook or PL/I include varies with each client. A facility exists called the File Definition Manager which is shipped as part of the TDM product. FDM runs on Windows (which means the mainframe COBOL copybook must first be sent to the PC) and provides a consistent format file known as the AFL (Advanced File Layout). This is frequently referred to as a DEFCSV for historical reasons.
The AFL must be transferred back to the mainframe and is referenced by the MAPDS parameter on the JCL/PROC. The purpose of the AFL is to provide the mapping (via field names) and data descriptions necessary for the masking program to be able to locate and process fields specified in the MAPCSV. It can be seen, therefore, that there is a close-coupled association between a file, its copybook, and the generated AFL.
Refer to documentation sections in "Working with Mainframe Files or IMS Segments" for the version of TDM you are running.