Page 1 of 1

Reading Fixed width file

Posted: Tue Jun 21, 2011 12:49 am
by mallikharjuna
I am not able to read fixed width file from sequential file stage

for Example

My Source file is

14.22 decimal(2,2)
7.4(decimal1,1)
abc(char 3)

Error Message:record_length=fixed" (no length given) and record field format is variable-length

i have tried to read source as all char type and converting decimal in first two filelds but when i am reading first column 14.22 (char 5) and my target is decimal(2,2). when i run the job warning is truncation in field.
please suggest how to read .

Thanks in advance

Posted: Tue Jun 21, 2011 3:00 am
by singhald
read all fields from fixed width file as char and then convert into requried datatype using trasformer or modify stage. your problem should be resolved

Posted: Tue Jun 21, 2011 8:02 am
by FranklinE
Based on what you wrote in your post, you might be misunderstanding how the decimal attribute is applied to the data. For example, your first field (if I read you correctly) should be (4,2), not (2,2). Your field length is four with two positions to the right of the decimal. If I'm correct, that's why you get the truncation warning.

Posted: Tue Jun 21, 2011 4:45 pm
by ray.wurlod
The actual field widths must be recorded in the Display Width field of the table definition. Use the Sequential File table definition importer and specify Fixed Width as the format and enter the field widths right there. Then use the imported table definition in your job.