TXT File with fixed length fields

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you have any VarChar columns change them to Char.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
joycerecacho
Participant
Posts: 298
Joined: Tue Aug 26, 2008 12:17 pm

Post by joycerecacho »

I tried but it didnt work.
And then I tested with only one char field, the same warning happened.
I can't realize what it could be.

Best regards.
Joyce A. Recacho
São Paulo/SP
Brazil
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Found this in an older post:
Kryt0n wrote:In order to get the fixed width file format recognised I have had to go to the Columns tab, right click, choose Edit Row and set a Field Width value for each row (i.e. the Length field despite being set, doesn't appear to be relevant to the field width)
-craig

"You can never have too many knives" -- Logan Nine Fingers
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

Perhaps you have done this already but it's not clear: Double check that there are no VarChar data types set on any column, and also for every column ensure there is a length value.
Choose a job you love, and you will never have to work a day in your life. - Confucius
joycerecacho
Participant
Posts: 298
Joined: Tue Aug 26, 2008 12:17 pm

Post by joycerecacho »

Yeap, but it is according to your tips.

The file input columns are like:

COD_MDL_ORG ........ char(4) nullable yes
TPO_RPT ................. char(1) nullable yes

Edit Row:
* COD_MDL_ORG
String Type : Field Width = 4
Nullable / Null Field Value = ""

* TPO_RPT
String Type : Field Width = 1
Nullable / Null Field Value = ""

What else should I set?
Joyce A. Recacho
São Paulo/SP
Brazil
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Not sure it applies much to writing a fixed-width file but wanted to point out that your "Null field Width" values need to match the size of your char field. So:

Code: Select all

Edit Row: 
* COD_MDL_ORG 
String Type : Field Width = 4 
Nullable / Null Field Value = "    " 

* TPO_RPT 
String Type : Field Width = 1 
Nullable / Null Field Value = " "
Four spaces and one space, respectively.
-craig

"You can never have too many knives" -- Logan Nine Fingers
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

Yes, that should "fix" the fixed-length. If not, please post any new and different errors.
Choose a job you love, and you will never have to work a day in your life. - Confucius
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The error message suggests that COL_MDL_ORG is of type VarChar.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

joycerecacho wrote:And It is not necessary the option 'Record Delimiter = Fixed'.
I assume you mean "Record length = fixed".
-craig

"You can never have too many knives" -- Logan Nine Fingers
joycerecacho
Participant
Posts: 298
Joined: Tue Aug 26, 2008 12:17 pm

Post by joycerecacho »

Nope .... I didnt set this option.
Joyce A. Recacho
São Paulo/SP
Brazil
Post Reply