Multi-Reader Directives (Technical Reference)

The Multi-Reader processes several directives in the underlying mapping file. You will see entries in the Translation Log when you run a workspace. For example:

Using Multi Reader with keyword `MULTI_READER' to read multiple datasets

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

Required/Optional

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.

Required

MULTI_READER_KEYWORD{#}

Contains the keyword the #th reader looks for when it scans the mapping file for its own settings.

Optional

MULTI_READER_DATASET{#}

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.

Optional

MULTI_READER_IDs{#}

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.

Optional

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

Required/Optional

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 asterisk (*) is required it indicates that the same reader type will be used for all datasets.

Required

MULTI_READER_VERBOSE

If thi flag is set to YES, then the Multi-Reader will log each reader it creates to the log file.

Optional

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

allows the Multi-Reader to skip over sub-readers when a dataset is missing or when an error is encountered by the sub-reader.

Value: Yes | No (default)