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
MULTI_READER_TYPE{#} Contains the type of the #threader 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 #threader looks for when it scans the mapping file for its own settings.
MULTI_READER_DATASET{#} This keyword is optional. If present, this overrides theDATASETsetting that the #threader would otherwise have used. Instead of the_DATASETbeing used, the dataset listed here is used for that reader.
MULTI_READER_IDs{#} This keyword is optional. If present, this overrides theIDssetting that the #threader would otherwise have used. Instead of the_IDsbeing used, those listed here are used for that reader.

It is important to note that the type or types specified by theMULTI_READER_KEYWORDare 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 useMULTI_READER, unless this keyword is explicitly set using theREADER_KEYWORDcommand (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 theMULTI_READER_DATASETkeyword. 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 toYES, then the Multi-Reader will log each reader it creates to the log file.

When theMULTI_READER_TYPE{*}keyword is used to specify the type of reader to be opened for each dataset in a folder, theMULTI_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 inIGDS_MASTER_UNITSbeing 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 areyesorno, and it defaults tonoif not specified by the user.