How to read fixed width files(Header,Trailer and detail rec)

This forum contains ProfileStage posts and now focuses at newer versions Infosphere Information Analyzer.

Moderators: chulett, rschirm

Post Reply
venki
Participant
Posts: 35
Joined: Wed Feb 28, 2007 5:09 am
Location: mumbai,

How to read fixed width files(Header,Trailer and detail rec)

Post by venki »

Hi,
I am new to profiling..
My source system is FIXEDWIDTH file. This file structure is ,
00123420090218
01234446venkgfftyhh123bbh 123 T02
01234447cenkgfftyhh123bbh 123 T02
01234448dbnkgfftyhh123bbh 123 T02
01234449aenkgfftyhh123bbh 123 T02
991234004
In which 1st line is header (start with 00, single record), lost line is trailer (start with 99 single record) and in between records are detail records(start with 01 multiple records).

My query is how to read this type of files and also how to define structure in QETXT.INI.

please suggest me.
venki
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That is NOT a fixed-width format. If it were, every record type would have the same length. What you can do is define every field as Char data type and the field delimited as 000.

Do you need to profile header and trailer information? If not, pre-process the file using a DataStage job so that it only has detail records in it. Then you can read the file as fixed-width format.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
venki
Participant
Posts: 35
Joined: Wed Feb 28, 2007 5:09 am
Location: mumbai,

Post by venki »

Hi ,

Thank you..

If i remove First line (header) and Lastline (Trailer) from the file, then it should be FIXED WIDTH file.

Please some one correct me if i am wrong?
venki
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I can not guarantee that. Only the provider of the file can guarantee that.
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