Importing Sequential File error

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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sounds like you are working with a fixed-width file, you said the record length was 205 bytes but it only found 204 in the actual record. Which number is correct?
-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 »

Hi Chulett.

The file is not a fixed-width one, it has delimiters between the fields.
Follow the file structure:

FIELD 1 ... integer (10)
FIELD 2 ... char (25) - changed to 'varchar'
FIELD 3 ... varchar (40)
FIELD 4 ... integer (10)
FIELD 5 ... char(15) - changed to 'varchar'
FIELD 6 ... decimal (13,2)
FIELD 7 ... char (10) - changed to 'varchar'
FIELD 8 ... varchar (117)
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 »

Well, the stage certain thinks it is fixed-width or it wouldn't complain about not finding exactly 205 bytes in the record. What are all of the settings you are using in the stage?
-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 »

The settings are:

Format:
Final Delimiter = none
Record Delimiter = UNIX newline

Field Defaults
Delimiter = Comma
Quote = double

All 'Varchar' are set as Extended = 'Unicode'

We are talking about a Unix file.
thanksss
Joyce A. Recacho
São Paulo/SP
Brazil
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What's the bet that this file was created on a Windows system and lines are terminated with CRLF? Try changing format to use Record Delimiter String property set to "DOS style".
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 »

Am I incorrect in stating that the error message implies an attempt to import a fixed-width file? Or at least what the stage believes to be a fixed-width file? Reading a delimited file does not entail needing to know the exact byte count of the record, instead it reads to the end-of-record mark and parses based on the delimiter.

And if the record delimiter was wrong, seems to me it would think it was one character too long rather than one too short...

[shrug]
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

This time I think you are incorrect. I further think that the LF was found at position 205, and there's a CR at position 204.
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