Page 1 of 1

Fixed width file job finished with see log

Posted: Fri Jan 12, 2007 4:56 am
by sourabhverma
Hi All,

I am reading a fixed width column file and loading into oracle table and in the same job in , before job subroutine i am calling unix script through which i am adding two constant value eg. STORE_ID & FILE_Date in the starting of each record.
But when i trigger the job it is finishing with see log having following error
" read_fixedwidth() - row 32, too many columns in record ".

This error is on last line of the file means 32 is the last line of file.

Pls suggest any solution for the same.

Posted: Fri Jan 12, 2007 5:04 am
by ray.wurlod
Add the missing line terminator to the last line of the file.

Posted: Fri Jan 12, 2007 5:12 am
by sourabhverma
Thanks Mr. Ray,

But I did not get the " missing line terminator ".
Anyways do i need to explicitly add the missing line terminator in the file or is there any other way for doing that.

Posted: Fri Jan 12, 2007 6:33 am
by sourabhverma
When I am viewing the file on the server, at the end of the last record it is showing ( ^M) character which is Carriage Return . so it is taking it into count & showing the error.

Posted: Fri Jan 12, 2007 8:25 am
by DSguru2B
Examine the last few lines. WHats different. If its fixed width, it will be easy to examine which record is the culprit and why.

Posted: Fri Jan 12, 2007 3:10 pm
by ray.wurlod
Well, if there's a line terminator, then there are too many characters in that line - your fixed width table definition specifies the width.

When you're viewing the file using a UNIX utility, is line #32 longer than line #31? Does line #32 contain any other non-printing characters, such as a tab (^I)?

Posted: Sat Jan 13, 2007 12:39 am
by sourabhverma
when i see last few lines of the file i see ( ^M) character only in the last line of the file. now i am treating that file after removing ( ^M) from the file by unix command
tr -d '\15' < File1.dat > File2.dat

After that i don`t get the error.