Page 1 of 1

Error when trying to read a fixed width file - EE

Posted: Fri Aug 11, 2006 9:29 am
by StuM
Hi All,

I am trying to read a fixed width file into a sequential file stage of a Parallel job. I set up the format as:

Record Length=Fixed

I have set up the column definitions with multiple fields, all character and of various lengths. I have double checked and the input file is the same length as the sum of the field lengths.

Problem is, when I try and view data, I get the following:

##I TUTL 000031 16:20:45(001) <main_program> The open files limit is 2000; raising to 2147483647.
##I TOSH 000002 16:20:45(002) <main_program> orchgeneral: loaded
##I TOSH 000002 16:20:45(003) <main_program> orchsort: loaded
##I TOSH 000002 16:20:45(004) <main_program> orchstats: loaded
##I TFSC 000001 16:20:45(005) <main_program> APT configuration file: /opt/Ascential/DataStage/Configurations/default.apt
##W TCOS 000049 16:20:46(000) <main_program> Parameter specified but not used in flow: FilePath
##W TCOS 000049 16:20:46(001) <main_program> Parameter specified but not used in flow: DSProjectMapName
>##E TOIX 000141 16:20:46(003) <sfWeeklyIdent> Unable to initialize the importer.
>##E TOIX 000000 16:20:46(004) <sfWeeklyIdent> "record_length=fixed" (no length given) and record field format is variable-length. The first variable-length field is "Ticker".>##E TFSR 000019 16:20:46(008) <main_program> Could not check all operators because of previous error(s)
>##E TCOS 000029 16:20:46(009) <main_program> Creation of a step finished with status = FAILED.


Any help that you can give here would be much appreciated. Thanks in advance.

Kind regards
Stu

Posted: Fri Aug 11, 2006 9:37 am
by kris007
Make sure and double check that your source file is a fixed width file first. Last time that happened to me, the table definitions were defined as fixed-width and file looked fixed-width but the last field in the file was of variable length. The spaces were not padded in the last field. So make sure, and try changing the table-defintion with final delimiter = end
and Record Delimiter =UNIX line, field delimiter as none and quote = double and then try testing by deleting last column in the sequential file and defining the length of the previous column as variable i.e. leave it blank and see if you are able to read the column. If not, let us know.

Posted: Fri Aug 11, 2006 9:44 am
by StuM
Hi Kris,

I made the changes that you suggested to the table definition and... it worked! Time to have another look at the data I guess!

TGI Friday :lol:

Thanks very much for your time.

Regards
Stu

Posted: Fri Aug 11, 2006 9:56 am
by kris007
Now make sure you parse the last column correctly(since you know the length of the last-but one column) so that you get your output correct. :wink:

Posted: Fri Aug 11, 2006 9:59 am
by StuM
kris007 wrote:Now make sure you parse the last column correctly(since you know the length of the last-but one column) so that you get your output correct. :wink:
Thanks, will do.

Found the culprit - the file is a concatenation of multiple files, each with there own header. I (wrongly) thought that all of these had been stripped in a previous job, but there was one left mid file, and it is much shorter that the other recs.

Cheers
Stu

Posted: Mon Aug 14, 2006 6:09 am
by mishrasanju
Hello ,

As per your explanation if I have a situation where in a new column of integer datatype has to be added to a an existing fixed length record,I have to convert the value to char first & pad spaces to the left so that length becomes fixed