Translator function
This feature allows translating data values in one or more fields based on a translate table containing lookup and/or result values. This feature allows for either unique or non unique result values. The Translator function accesses the translate table based on values from the fields specified on the formatted panel in five different ways:
- Binary search (S): Sorts the values internally and performs a binary search thereby speeding up processing.
- Key search (K): Your search field matches the key field when your table file is a KSDS (Keyed Sequential Dataset). The table is always directly accessed by key.
- Access methods K, H, and U with a KSDS translate table will not load the translation table into memory.
Direct row pointer search (D): The search field is hashed to a random number between 1 and the number of rows in the table. The resulting number determines the row to be used.
- Hash to a key search (H): Similar in function to the Direct Row Pointer Key search except that the random number is used to perform the Key search. The search field is hashed to a random number between 1 and the number of rows in the table. For the Hash function to work, the key of the VSAM file must be numeric with leading zeros, start with 1, and increment by 1 for each row.
- Unique Key search (U): Each different input value returns a different entry number which is used to access the replacement values from the translate table.
When the corresponding row is determined, the Translator function returns the result values and uses them to replace the specified output field value.
Data translation relational operators S and K do not replace/disguise fields if the search key value is not found in the translate table. Data translation relational operator U does not replace/disguise fields if there are more unique values in the search key than number of rows in the translate table, but Data Solutions issues a message. For relational operators S and K, if the following set does not specify translation failed selection criteria (relational operator TF), the condition is not reported. If you want to be advised of this condition, and/or want to disguise the fields that data translation failed to disguise, then specify TF on the set immediately following the data translation set. For an example of how to use TF, see Defining Your Third Criteria Set. Data translation relational operators H and D may result in selecting duplicate replacement rows. Use unique key search U when duplicates are not acceptable. The maximum size of a Unique Value Table (UVT) is 2 gigabytes (2,147,483,647). The required size is calculated as (number of rows in the corresponding translate table + 4) * (13 + the total search key length).
For example: Let’s assume you want to apply area code changes to phone number fields. To complete a split of an area code, there are usually many exchanges within one area code that need to be assigned a new area code. Usually, a program is written that searches for the old area code and all of the exchanges, then assigns the new area code. Thus, there is more than one field to be searched for and multiple values that need to be searched for.
Data Translator makes global changes easy. It allows you to specify a field/table, the translate table, that contains all of the old area codes, the exchanges to be changed, and the new area code. This table is then used to change the fields as specified on the formatted screen. No program needs to be written, and specifying which files and fields need the changes is also easy. Since the translate table is an external file and the JCL can be saved, it is easy to replace the file for each new area code split that needs to happen and re-execute the change.
This function can be accessed by selecting Option 4 (Translator) from the Primary Option Menu.
Input and Output Specifications
The input and output options are the same for each Data Solutions function. See Input Specification and Output Specification for a sample and field descriptions for these screens. In addition, the Criteria Menu is displayed within each Data Solutions function. See Criteria Menu for a description of the Criteria Menu.
This section provides information about the following topic: