Example - Defining Fixed-field Columns

You want to define columns for a fixed-field source file in which each record is 38 bytes long and encompasses five data fields.

Procedure

You specify in the New Data Source wizard that the first field is an 8-byte numeric field giving the date of a transaction. The next 14-byte field indicates the product type. Note that the type Product1 uses fewer than the 14 bytes available in the field. An 8-byte field indicates the color of each item sold. The last 8 bytes store monetary values for the measure fields Cost (4 bytes) and Revenue (4 bytes).

Results

Cognos® Transformer can now correctly interpret the columns. For example, the first record represents a transaction that generated 330 in revenue, occurring on January 3, 2007, involving Product1, Color1, that cost 214 to produce.

Example

Column 1

Column 2

Column 3

Column 4

12345678 90123456789012 34567890 12345678
20070103 Product1 Color1 02140330
20070103 Product1 Color2 02870335
20070103 Product2 Color1 04560508
20070103 Product2 Color3 03110388