9.222.1 Output File Formats

Currently the following output formats are supported. In the examples this notation is used:

<OptCR>

Indicates an optional carriage return character.

<nl>

Indicates a new line (or line feed) character.

<t>

Indicates a horizontal tab character.

A - Normal Delimited File

B - DBF File

C - Columnized File (Numeric Fields Have Leading Signs)

D - Columnized File (Numeric Fields do NOT have Signs)

O - Comma Delimited File

T - Horizontal Tab Delimited Files

dBASE III PLUS Field Format Supported

A - Normal Delimited File

Alphanumeric values are enclosed in double quotes except Boolean values which are either T (TRUE) or F (FALSE).

Alpha and Char empty values have one space between double quotes (e.g. " ")

String values with trailing blanks do not have blanks removed.

Integer, Float, Packed and Signed fields appear with a leading negative sign, leading zeros suppressed and a decimal point (where required).

Individual fields are delimited by a comma (,).

The length of each file record may vary.

The position of an individual field within a record may vary from record to record. This is not a "fixed format" file. For example:

"SMITH","IAN",2153,345.56,"ADM",-456.78<OptCR><nl>

B - DBF File

This option tells the BIF to produce dBASE III PLUS, without memo DBF files. It is another common file format used to exchange information with other environments such as Microsoft Excel. Refer to dBASE III PLUS Field Format Supported more details.

There are limitations to this option. Below are listed both supported and non-supported types.

Supported Types

Alpha/Char/String ( up to 254 bytes only ), stored as Character

Packed and Signed field values are stored as DBF Numeric.

Date field value is stored as DBF Date

DateTime field value is stored as DBF  Timestamp. Fraction may be lost during the transforming process.

A Timestamp value occupies 8 bytes in DBF file – two longs, first for date, second for time.  The date is the number of days since  01/01/4713 BC ( Julian day ) . Time is hours * 3600000L + minutes * 60000L + Seconds * 1000L. Please refer Julian Day Count for details about Julian Day Count algorithm.

Time field value is stored as DBF Timestamp. But only last 2 bytes will be used. The value of the first 2 bytes will be 1900-01-01

Integer field value is stored as DBF Numeric. 1 byte Integer occupies 4 bytes including sign. 2 bytes Integer occupies 6 bytes including sign . 4 bytes Integer occupies 11 bytes including sign. 8 bytes Integer occupies 20 bytes. The value firstly is converted to a string (radix 10), if the length of the string is smaller than the required length, it will be right padded by BLANKs.

Float field value is stored as DBF Double.

Boolean field value is stored as DBF Logical

Unsupported Types

Alpha, Char, String with length > 254, Integer 8, BLOB and CLOB.

C - Columnized File (Numeric Fields Have Leading Signs)

Produces a columnized or "fixed format" file. The length of each file record is identical (unless appendage lists are used ... see later note) and the position of an individual field is identical within each record.

The width of a field's resulting column (and thus the overall "record layout" of the file) can be predicted by the following rules:

A(12) A(9) S(4,0) P(9,2) A(3) P(7,2)

..........:........:....:..........:..:........ SMITH IAN +2153+0000345.56ADM-00456.78<OptCR><nl>

D - Columnized File (Numeric Fields do NOT have Signs)

  • Produces a file exactly as for type "C" except that Packed, Signed, Integer and Float fields do not have a leading sign. For examples:
  • With decimal points included:

    A(12) A(9) S(4,0)P(9,2) A(3) P(7,2)

    ..........:........:...:.........:..:....... SMITH IAN 21530000345.56ADM00456.78<OptCR><nl>

     

    With decimal points removed:

    A(12) A(9) S(4,0)P(9,2) A(3) P(7,2)

    ..........:........:...:........:..:...... SMITH IAN 2153000034556ADM0045678<OptCR><nl>

  • All the rules applied to predict the width of a fields resulting column are the same as for type "C" with an exception for Packed, Signed, Integer or Float fields: 1 must be subtracted from the result.
  • Float field Note:
    The Float field value is converted into  "scientific notation" representation.
    For example:
    The biggest double float value that can be handled by some C compilators in "scientific notation" representation is: 1.7976931348623158E+308

    O - Comma Delimited File

    A common file format. It has exactly the same format as type A files except that Alpha, BLOB, CLOB Date, DateTime, Time , Char and String fields are not enclosed in double quotes.

    T - Horizontal Tab Delimited Files

    A popular file format. It has exactly the same format as type A files except that Alpha, BLOB, CLOB Date, DateTime, Time , Char and String fields are not enclosed in double quotes and individual fields are delimited by the horizontal tab character. For example:

    SMITH<t>IAN<t>2153<t>345.56<t>ADM<t>-456.78<OptCR><nl>