Reading Fixed width file

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
mallikharjuna
Participant
Posts: 81
Joined: Thu Nov 30, 2006 7:46 am
Location: india

Reading Fixed width file

Post 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
MALLI
singhald
Participant
Posts: 180
Joined: Tue Aug 23, 2005 2:50 am
Location: Bangalore
Contact:

Post 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
Regards,
Deepak Singhal
Everything is okay in the end. If it's not okay, then it's not the end.
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post 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.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
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