Directives
The Multi-Reader processes several directives in the mapping file. When reading from datasets of different types or datasets of the same type that are not located in the same folder, each reader must be explicitly specified. This mode of the Multi-Reader is configured with the following keywords.
Keyword | Value |
MULTI_READER_TYPE{#} | Contains the type of the #th reader to use. # starts at zero and increases for each different reader that will be used. |
MULTI_READER_KEYWORD{#} | This keyword is optional. Contains the keyword the #th reader looks for when it scans the mapping file for its own settings. |
MULTI_READER_DATASET{#} | This keyword is optional. If present, this overrides the DATASET setting that the #th reader would otherwise have used. Instead of the <readerKeyword>_DATASET being used, the dataset listed here is used for that reader. |
MULTI_READER_IDs{#} | This keyword is optional. If present, this overrides the IDs setting that the #th reader would otherwise have used. Instead of the <readerKeyword>_IDs being used, those listed here are used for that reader. |
It is important to note that the type or types specified by the MULTI_READER_KEYWORD are not valid in the correlation lines because, when using the Multi-Reader, the source of data for the run is the logical dataset created by the Multi-Reader. Thus, the input part of the correlation lines must use MULTI_READER, unless this keyword is explicitly set using the READER_KEYWORD command (Example 3 shows how to do this).
When the Multi-Reader is configured to access multiple datasets of the same type that are located in a common folder, the following keywords are used:
Keyword | Value |
MULTI_READER_TYPE{*} | Contains the type of the reader to use for all the datasets found in the folder specified by the MULTI_READER_DATASET keyword. The * is required, it indicates that the same reader type will be used for all datasets. |
MULTI_READER_VERBOSE | If this optional flag is set to YES, then the Multi-Reader will log each reader it creates to the log file. |
When the MULTI_READER_TYPE{*} keyword is used to specify the type of reader to be opened for each dataset in a folder, the MULTI_READER_KEYWORD{#} is not specified. In this case, the FME makes the reader keyword the same as the reader type. This generic reader keyword is used by all the individual readers when they scan the mapping file for reader-specific settings. For example, the following lines:
MULTI_READER_TYPE{*} IGDS IGDS_UNITS IGDS_MASTER_UNITS
result in IGDS_MASTER_UNITS being used by every reader created.
The examples illustrate these concepts in detail.
The following are additional keywords for the Multi-Reader:
Keyword | Value |
CONTINUE_ON_READER_FAILURE | This keyword allows the Multi-Reader to skip over sub-readers when a dataset is missing or when an error is encountered by the sub-reader. The valid values of this keyword are yes or no, and it defaults to no if not specified by the user. |