The File Update utility updates one file, called the master file (Master), with the data contained in another file, called the transaction file (Tran).
- match keys
- An attribute name that appears in both the master and transaction files. You can define up to five match keys for the File Update utility.
Based on the results of the comparison, the File Update utility:
- Separates the rows in the transaction and master files into multiple output files for review or processing. (See Outputs for a description of the output files.)
- For matched rows, identifies common attributes and overwrites the master file values with the values in the transaction file.
- For matched rows, adds attributes that appear only in the transaction file to the master file.
- Example 1
-
In these sample master and transaction files, the following attributes are used:
The Match Master output file includes the attributes shown in the graphic below. The value in the common attribute, Record#, is overwritten by the value in the transaction file.
- Example 2
-
In this example, the master file contains the customers’ names and the transaction file contains the customers’ addresses. The match key is the Record_Key attribute.
Master Input File
Transaction Input File
Output Schema
Output Files
You can configure what output files you want the program to create and, optionally, define filters for each file. The following paragraphs describe the output options available.
- The program searches for rows in the Master file that have the same key values as the rows in the Transaction file. In this example, the rows with "0001" and "0002" in the Record_Key attribute are matched rows.
- Rec #1 in the Master file and Rec #100 in the Transaction file are the matched rows because they matched first. Similarly, Rec #3 and Rec # 300 are the matched rows.
- In the Match Master file, the values in the "Rec#" attribute are updated with the values in the Transaction file, and all address-related attributes and their values are added to the Match Master file, as shown below.
- Rec #2 in the Master file is a duplicate matched row because it appeared after the first matched row (Rec #1). Therefore, Rec #2 is written out to the Match Master Duplicate file.
Note: Duplicate rows are additional rows with the same key that appear after the first match occurs.- Rec #4 in the Master file is an unmatched row because it does not share the same key value with any rows in the Transaction file. Therefore, Rec #4 is written out to the Unmatch Master file.
- The matched rows in the Transaction file are written out to the Match Transaction file to show which transaction rows are matched to a master row. If there are any matched duplicate, unmatched, or unmatched duplicate rows on the transaction file, they are also written out to separate files.