Error Reading a Fixed Width File
Moderators: chulett, rschirm, roy
Error Reading a Fixed Width File
Hi,
I am having a fixed width file:
File contains these three records
ram1234 sam
ra 123 1sam
ram12342sam
The metadata is:
fname varchar 4
mark integer 4
id char 1
lname varchar4
In the Format tab I have set:
at Record Level
Record length=Fixed
and at Field Defaults:
Delimiter=none
When i try view data ,I am getting following error:
#E TOIX 000141 16:26:05(001) <Sequential_File_0> Unable to initialize the importer.
>##E TOIX 000000 16:26:05(002) <Sequential_File_0> "record_length=fixed" (no length given) and record field format is variable-length. The first variable-length field is "mark".
>##E TFSR 000019 16:26:05(006) <main_program> Could not check all operators because of previous error(s)
>##E TCOS 000029 16:26:05(007) <main_program> Creation of a step finished with status = FAILED.
Should I add additional properties?
Any help is appreciated.
I am having a fixed width file:
File contains these three records
ram1234 sam
ra 123 1sam
ram12342sam
The metadata is:
fname varchar 4
mark integer 4
id char 1
lname varchar4
In the Format tab I have set:
at Record Level
Record length=Fixed
and at Field Defaults:
Delimiter=none
When i try view data ,I am getting following error:
#E TOIX 000141 16:26:05(001) <Sequential_File_0> Unable to initialize the importer.
>##E TOIX 000000 16:26:05(002) <Sequential_File_0> "record_length=fixed" (no length given) and record field format is variable-length. The first variable-length field is "mark".
>##E TFSR 000019 16:26:05(006) <main_program> Could not check all operators because of previous error(s)
>##E TCOS 000029 16:26:05(007) <main_program> Creation of a step finished with status = FAILED.
Should I add additional properties?
Any help is appreciated.
Thanks
-
- Premium Member
- Posts: 783
- Joined: Mon Jan 16, 2006 10:17 pm
- Location: Sydney, Australia
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Use Char, not VarChar, and specify the display widths.
Code: Select all
fname Char(4) width 4
mark Integer width 4
id Char(1) width 1
lname Char(4) width 4
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod wrote:Use Char, not VarChar, and specify the display widths.Code: Select all
fname Char(4) width 4 mark Integer width 4 id Char(1) width 1 lname Char(4) width 4[/co ...[/quote] Hi Ray, Where can i specify display widths? :? like server jobs ,I do not have a display column here. Also I tried using everything as CHAR & Integer,yet I am getting the same error.Kindly help. Thanks in advance.
Thanks
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Thanks Ray.ray.wurlod wrote:In the extended job properties - it's called Field Width. Right click on row in Columns grid and choose Edit Row... from the menu. ...
I have set Field Width as you have told.
Now Out of 5 rows in my seq file,i can only see 1st 2 rows.
While trying to view data,the following warning message is thrown:
Error executing View Data command:
##E TOIX 000159 10:03:06(008) <Sequential_File_0,0> Short read encountered on import; this most likely indicates one of the following possibilities:
Thanks
Please post the complete error.When i try view data ,I am getting following error:
#E TOIX 000141 16:26:05(001) <Sequential_File_0> Unable to initialize the importer.
>##E TOIX 000000 16:26:05(002) <Sequential_File_0> "record_length=fixed" (no length given) and record field format is variable-length. The first variable-length field is "mark".
>##E TFSR 000019 16:26:05(006) <main_program> Could not check all operators because of previous error(s)
>##E TCOS 000029 16:26:05(007) <main_program> Creation of a step finished with status = FAILED.
Birendra
-
- Participant
- Posts: 247
- Joined: Thu Apr 27, 2006 6:38 am
- Location: Hyderabad
dsdoubt - you cannot use any varying column such as VarChar or VarBinary but you can use decimal and integer. Just specify lengths.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>