How to define Fixed Width Format for a Target File

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
deepa_shenoy
Participant
Posts: 95
Joined: Thu Sep 24, 2009 12:15 am
Location: India

How to define Fixed Width Format for a Target File

Post by deepa_shenoy »

Hi,

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

What all options do we select?

Regards,
Deepa
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

One of the sequential file settings is for fixed width output, then make sure you don't have any VarChar() columns.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
deepa_shenoy
Participant
Posts: 95
Joined: Thu Sep 24, 2009 12:15 am
Location: India

Post 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?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Prefer Null Field Value to Null Length. Specify record length in your metadata.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
deepa_shenoy
Participant
Posts: 95
Joined: Thu Sep 24, 2009 12:15 am
Location: India

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The Null Field Value for a Char(10) column must have precisely 10 characters.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply