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
Error Reading Char Field from Sequential File
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
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.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".
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.
It needs to be declared as a varchar as well.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers