Reader Directives

The suffixes listed are prefixed by the current <ReaderKeyword> in a mapping file. By default, the <ReaderKeyword> for the DBF reader is DBF.

DATASET

Required/Optional: Required

This is the name of a folder containing one or more DBF files, or a single DBF file. The extension for DBF files is .dbf.

Example:

DBF_DATASET /usr/data/dbf/input

Workbench Parameter: Source dBASE (DBF) File(s)

DEF

Required/Optional

Required

Each DBF file may optionally be defined before it can be read. The definition specifies the base name of the file, and the names and the types of all attributes.

Example:

<ReaderKeyword>_DEF <baseName> \
[<attrName> <attrType>]+

The following table shows the attribute types supported.

Field Type

Description

char(<width>)

Character fields store fixed length strings. The width parameter controls the maximum number of characters that can be stored by the field. No padding is required for strings shorter than this width.

date

Date fields store date as character strings with the format YYYYMMDD.

number(<width>,<decimals>)

Number fields store single and double precision floating point values. The width parameter is the total number of characters allocated to the field, including the decimal point. The decimals parameter controls the precision of the data and is the number of digits to the right of the decimal.

logical

Logical fields store TRUE/FALSE data. Data read or written from and to such fields must always have a value of either true or false.

memo

The reader can read dBASE III, IV and FoxPro memo fields.When writing, only dBASE III format memo fields are supported.

The example below is a DEF line for the trees DBF file that has the attributes name and id_number:

DBF_DEF trees \
	name char(30) \
		id_number number(11,0)

IDs

Required/Optional

Optional

This optional specification limits the available and defined DBF files read. If no IDs are specified, then all defined and available DBF files are read.

The syntax of the IDs keyword is:

<ReaderKeyword>_IDs <baseName> \
	<baseName1> … \
	<baseNameN> 

The basenames must match those used on the DEF lines.

The example below selects only the pipeline DBF file for input during a translation:

DBF_IDs pipeline

ENCODING

Required/Optional

Optional

This optional specification controls which character encoding is used to interpret text attributes from the DBF file. If the value is not set, then the character encoding will be automatically detected from the source DBF file. If the value is set, it will take precedence over the automatically detected character encoding.

This directive is useful when the character encoding information stored in the DBF file is missing or incorrect.

Example:

<ReaderKeyword>_ENCODING <character encoding>

Workbench Parameter

Character Encoding

Parameter

Description

<character encoding>

The character encoding to use when interpreting text attributes. Must be set to any of the following values:

ANSI - this means use the “current OS language”

BIG5

EUC

ISO

OEM

SJIS

UTF-8

CP437

CP708

CP720

CP737

CP775

CP850

CP852

CP855

CP857

CP860

CP861

CP862

CP863

CP864

CP865

CP866

CP869

CP932

CP936

CP950

CP1250

CP1251

CP1252

CP1253

CP1254

CP1255

CP1256

CP1257

CP1258

ISO8859-1

ISO8859-2

ISO8859-3

ISO8859-4

ISO8859-5

ISO8859-6

ISO8859-7

ISO8859-8

ISO8859-9

ISO8859-13

ISO8859-15

TRIM_PRECEDING_SPACES

Required/Optional: Optional

This option specifies whether the reader should trim preceding spaces of attribute values. If the option is set to YES, then preceding spaces in attribute values will be discarded. If the option is set to NO, then preceding spaces will be left intact. The default value is YES.

Workbench Parameter: Trim Preceding Spaces

EXPOSED_ATTRS

This directive allows the selection of format attributes to be explicitly added to the reader feature type.

This is similar to exposing format attributes on a reader feature type once it has been generated; however, it is even more powerful because it enables schema-driven applications other than Workbench to access and leverage these attributes as if they were explicitly on the schema as user attributes.

The result of picking a list of attributes is a comma-separated list of attribute names and types that will be added to the schema features. Currently all reader feature types will receive the same set of additional schema attributes for a given instance of the reader.

Required/Optional

Optional

Mapping File Syntax

Not applicable.

While it is possible for FME Objects applications to invoke this directive, the required format is not documented.

This directive is intended for use in our GUI applications (for example, Workbench) only.

Workbench Parameter

Additional Attributes to Expose