Page 1 of 1

How to define Fixed Width Format for a Target File

Posted: Thu Nov 26, 2009 4:23 am
by deepa_shenoy
Hi,

How do we define a Fixed Width Format for a Target File?

What all options do we select?

Regards,
Deepa

Posted: Thu Nov 26, 2009 8:53 am
by ArndW
One of the sequential file settings is for fixed width output, then make sure you don't have any VarChar() columns.

Posted: Thu Nov 26, 2009 1:13 pm
by ray.wurlod
The easiest way is while importing the table definition of that file (assuming it exists) or creating the table definition (assuming it doesn't exist). Record the width of each field, which is stored in the Display Width field.

Posted: Thu Nov 26, 2009 10:17 pm
by deepa_shenoy
Its currently throwing these errors:

1)Error when checking operator: Unable to initialize the exporter.
or
Error when checking operator: Export validation failed.

2)Error when checking operator: "record_length=fixed" (no length given) and record field format is variable-length. The first variable-length field is "cust_name".

3)Error when checking operator: At field "cust_state": "null_length" may only be used in conjunction with prefix length or link length
Error when checking operator: At field "rating": "null_length" may only be used in conjunction with prefix length or link length
Error when checking operator: At field "numb": "null_length" may only be used in conjunction with prefix length or link length


The source has datatype Varchar, but in the file, while importing metadata, I changed Varchar to char.

Any solution?

Posted: Thu Nov 26, 2009 10:45 pm
by ray.wurlod
Prefer Null Field Value to Null Length. Specify record length in your metadata.

Posted: Thu Nov 26, 2009 10:54 pm
by deepa_shenoy
I did do that initially but it threw warnings saying that Null field length does not match the columns fixed width length. I had given Null Field value as '\xAB' and fixed length of the field as 10.

Posted: Fri Nov 27, 2009 12:48 am
by ray.wurlod
The Null Field Value for a Char(10) column must have precisely 10 characters.