Bad record delimiter Fixed width length "\n" got &

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
laknar
Participant
Posts: 162
Joined: Thu Apr 26, 2007 5:59 am
Location: Chennai

Bad record delimiter Fixed width length "\n" got &

Post by laknar »

Bad record delimiter Fixed width length "\n" got " "

trying to load fixed width file thru sequential file
but getting the above error.

Im sure the record lenth is correct.

I beleive the mode of file transfer is wrong.

when i tried to check the file format in unix its showing-English text

How can i change the file into Ascii text.

Can anyone help me.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Post the actual, complete, unedited error. Also curious what you believe the difference between "English text" and "Ascii text" to be. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
laknar
Participant
Posts: 162
Joined: Thu Apr 26, 2007 5:59 am
Location: Chennai

Post by laknar »

Error reading on import.
Bad record delimiter after fixed-length record: expected "\n", got " "
Import error at record 0.
The runLocally() of the operator failed.

The Fatal errors im facing
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The problem is in the first line of your file (record 0).

Please post both the record schema and the first line of the file.

Surround each (separately) with Code tags please. It makes it easier to count characters if you do so.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
laknar
Participant
Posts: 162
Joined: Thu Apr 26, 2007 5:59 am
Location: Chennai

Post by laknar »

schema record
{record_delim='\n', record_length=fixed, delim=none}
(
A:nullable string[1] {width=1};
B:nullable string[5] {width=5};
C:nullable string[5] {width=5};
D:nullable string[30] {width=2};
E:nullable string[9] {width=1};
F:nullable string[3];
)

The first line of record is below

abc 32123ffcscfdscsddsfcsdcsdcsdccdscds df

when i tried to run im getting the below error

Bad record delimiter after fixed-length record: expected "\n", got "d"
Import error at record 0.
The runLocally() of the operator failed.
laknar
Participant
Posts: 162
Joined: Thu Apr 26, 2007 5:59 am
Location: Chennai

Post by laknar »

-schema record
{record_delim='\n', record_length=fixed, delim=none}
(
A:nullable string[1] {width=1};
B:nullable string[15] {width=15};
C:nullable string[2] {width=2};
D:nullable string[8] {width=8};
E:nullable string[8] {width=8};
F:nullable string[5] {width=5};
G:nullable string[13] {width=13};
H:nullable string[1] {width=1};
I:nullable string[3] {width=3};
J:nullable string[8] {width=8};
K:nullable string[7] {width=7};
L:nullable string[5] {width=5};
M:nullable string[20] {width=20};
N:nullable string[44] {width=44};
O:nullable string[1] {width=1};
P:nullable string[6] {width=6};
Q:nullable string[8] {width=8};
R:nullable string[15] {width=15};
S:nullable string[80] {width=80};
)

This is another fixed width file record schema.
when i run this im not getting any error like bad record.
can any one suggest me pls?
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Post by sud »

To me it looks like since the record type is fixed, datastage is reading the record length number of characters. Now, there should be spaces for the columns E and F in the first record since they are null, but if there are none, datastage will read upto the second record and then look for a record delimiter. Since it has already passed to the second record it is finding a D wherever it stopped reading.
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Take a look at your data record based on the widths in the record schema. That these widths are specified means that this is how DataStage is parsing the record. In particular D will take only two characters from the record, and be padded with 28 pad characters.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
laknar
Participant
Posts: 162
Joined: Thu Apr 26, 2007 5:59 am
Location: Chennai

Post by laknar »

Hi,

Thanks for your input.
I have widths and its working fine.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Please mark the thread as Resolved
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