Fixed width file job finished with see log

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
sourabhverma
Participant
Posts: 74
Joined: Thu Jan 05, 2006 2:07 am

Fixed width file job finished with see log

Post 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.
Thanks,
Sourabh Verma
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Add the missing line terminator to the last line of the file.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sourabhverma
Participant
Posts: 74
Joined: Thu Jan 05, 2006 2:07 am

Post 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.
Thanks,
Sourabh Verma
sourabhverma
Participant
Posts: 74
Joined: Thu Jan 05, 2006 2:07 am

Post 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.
Thanks,
Sourabh Verma
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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)?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sourabhverma
Participant
Posts: 74
Joined: Thu Jan 05, 2006 2:07 am

Post 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.
Thanks,
Sourabh Verma
Post Reply