Filler Fields for Exports

Top  Previous  Next

For specifying output records ONLY, the directive options filler={list_of_attributes} can used as often as needed to describe an extra "filler" field, i.e. one not derived from the SELECT query, in the layout of the record. The rules work differently according to whether you are specifying the output as fixed length or delimited records.

There is no way to pass these descriptors from the command line:  they must be on an options line in a control file.

Specifying Filler Fields

Each filler entry describes one field.  The list_of_attributes consists of four arguments in a pre-defined order and separated by semi-colons.  The arguments are not case-sensitive.  The format is:

options filler=s;e;t;f 

The variables=N option is required if one or more filler entries are present.

Filler Attribute List Arguments

Argument

Position

Usage

s

First

s is a number specifying the starting position

for fixed-length records, s is 1 for the first character of the first field.
for delimited records, s is 1 for the first field

e

Second

e is a number:

for fixed-length records, e specifies the ending position for the field in the record.  The size of the fixed-length field is thus (e - s + 1).
for delimited records, an e value is used only if the t argument is used, in which case it expresses the size of the value specified by the t argument

SIZE MATTERS!
When interpolating non-database fields into output records, overlaps will cause the process to stop and complain.  Take care that you allow enough space to accommodate the maximum possible size of the generated data.

t

Third

t can be one of three things:

a)a single character specifying the fill character to be used to fill the field.  Suggested characters are  blank, zero, or dash.  (For blanks, leaving the argument empty is equivalent to typing in a space character.)
b)the keyword SYSDATE to output the host server date or date/time, supported by a valid date format attribute specified as the f argument
c)the keyword ENUM to output the value as a record counter (generated as (record count + startcount)) specified by a valid number format attribute as the f argument

f

Last

f is a number or string constant for the external format of the field where a keyword was specified for the t argument.  It is ignored if the t argument was used to specify a filler character.

If t=SYSDATE, the number constants and templates for the range of date formats are explained in the section Date/Time Data.

If t=ENUM, the following string constants are valid:           

FmtInt16 (binary, size 2 - if less than 32,768 records will be selected)
FmtInt32 (binary, size 4)
FmtInt64 (binary, size 8)
FmtCstring (for delimited file)
FmtFixString (for fixed file - size must be large enough for the number of digits expected)

Overlapping Fields

Use this option as many times as you have extra fields to include but take care that your specifications do not cause fields to overlap one another.

If you actually intend for input fields to overlap, dbFile allows it
If you try to overlap output fields, the process will be aborted

Representing Null Arguments

All four arguments are required in the list_of_attributes.  Where an argument is null, omit the value but include the separator.  For example, the following directive will work fine to put :

options filler=4;;sysdate;18