Error Reading Char Field from Sequential File

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
ajmore
Participant
Posts: 22
Joined: Fri Aug 25, 2006 5:25 am

Error Reading Char Field from Sequential File

Post by ajmore »

Hi All :)

I have to read a sequential file(records r comma seperated), apply transformation and insert data into dataset.I am specifying Metadata for col1 as char(6) and col2 as varchar(30).Input Data is as follows(First Line is Col. name)

statecode,statefullnametext

ACT,Australian Capital Territory
NSW,New South Wales
NT,Northern Territory

but while reading the File i am getting following Error

<Sequential_File_23,0> Field "statecode" delimiter not seen, at offset: 6
<Sequential_File_23,0> Import warning at record 0.
<Sequential_File_23,0> Import unsuccessful at record 0.
<Sequential_File_23,0> Field "statecode" delimiter not seen, at offset: 6
Missing record delimiter "\n", saw EOF instead


But when i use First Col. DataType as varchar(6) job is working fine..
Please suggest me the solution to use char datatype and why it is so.......

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

Post by ray.wurlod »

Is the "First Line is Column Names" property set to True? This does need to be explicitly set - it does not import with the other format information, because it is a stage property whereas the other format information form link properties.

I suspect that this is the problem because the error is reported from row #0 (the first line in the file).

The other possibility is that this line has the wrong number of commas in it.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ajmore
Participant
Posts: 22
Joined: Fri Aug 25, 2006 5:25 am

Post by ajmore »

ray.wurlod wrote:Is the "First Line is Column Names" property set to True? This does need to be explicitly set - it does not import with the other format information, because it is a stage property whereas the other ...


Thanks for the quick response ray..
I have set the "First Line Column Names" property to True..
and while importing seq. file metadata the record level delimiter is set to "Unix Newline" while Final Delimiter as "end" and pad char as "space".
pavankvk
Participant
Posts: 202
Joined: Thu Dec 04, 2003 7:54 am

Post by pavankvk »

ajmore wrote:
ray.wurlod wrote:Is the "First Line is Column Names" property set to True? This does need to be explicitly set - it does not import with the other format information, because it is a stage property whereas the other ...


Thanks for the quick response ray..
I have set the "First Line Column Names" property to True..
and while importing seq. file metadata the record level delimiter is set to "Unix Newline" while Final Delimiter as "end" and pad char as "space".
The actual problem is with a comma delimited file you shouldnt specify the length. you specified the first column as char(6) so datastage importer tries to locate a , at position 6 where as your data in the first column is only 3 bytes. when even you use comma delimited dont specify length for a char data type.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It's not about specifying the length per se, but about char versus varchar. When you declared the first field to be a char(6), that means it will always have 6 characters in it - period. DataStage isn't seeing that.

It needs to be declared as a varchar as well.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply