Reading a fixed length flat file- no delimiter

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
dsedi
Participant
Posts: 220
Joined: Wed Jun 02, 2004 12:38 am

Reading a fixed length flat file- no delimiter

Post by dsedi »

Hi All,

We started receiving some flat file inputs without any delimiter on it.
(continious stream of charecters) We need to split into columns based on the charecter position in the paricular row.
(for ex, char 1 to 10 Column1,char 11 to 15 column2..etc....)
which stage will be most appropriate to handle this?
any valuable Idea's?

Thanks in advance.
Edi
jenkinsrob
Participant
Posts: 31
Joined: Mon Dec 01, 2003 6:24 am
Location: London

Post by jenkinsrob »

You should be able to handle this with the Sequential File Stage.

Set all your datatypes to CHAR and specify the length of each column in the file.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Exactly; the Sequential File stage is precisely the correct stage type to use.

You will need to specify the format as fixed width. The best way to do this is to import the file's "table definition" and specify there that it's fixed width format and the width of each column.

From the table definition in the Repository you can then Load the format into a Sequential File stage in your job design. The format information is largely untouched by human hands and therefore likely to be correct.
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