Dynamically handling 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
san_dwh
Participant
Posts: 17
Joined: Tue Dec 28, 2010 9:05 am
Location: hyd

Dynamically handling file

Post by san_dwh »

Hi
I am new to datastage. In my project, one text file changing dynamically i.e, initially i have 25 fields.some times I am getting 30-35 fields. How can I handle this situation.

Thanks...
soumya5891
Participant
Posts: 152
Joined: Mon Mar 07, 2011 6:16 am

Re: Dynamically handling file

Post by soumya5891 »

If the no of fields in the source file get changed then the whole job flow will be affected.in this case what is the exact scenario?
Soumya
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Are you reading or writing this file?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
san_dwh
Participant
Posts: 17
Joined: Tue Dec 28, 2010 9:05 am
Location: hyd

Post by san_dwh »

hi ray,

I am reading that file
leomauer
Premium Member
Premium Member
Posts: 100
Joined: Mon Nov 03, 2003 1:33 pm

Post by leomauer »

Assumptions:
1. The file is delimited.
2. Only fields that exist in every file need to be processed and the varying part of the record is not processed.
3. The required fields are always in the same position in the record.

I would do it in transformer:
1. Define the input file record as unbound varchar (no length).
2. Use Field transformer function to parse the required field.

You can do something similar in non-delimited file by when assumption 2 and 3 still valid. In this case the Substring function instead of Field function.

But this kind of file sounds very unusual to me. Except for Cobol files with varying record length, I never encountered such file structure. I would question the source system first to verify if the file is produced consistently by the same program.

If the assumptions 2 and 3 are not true, I do not see the way to process the file.
Post Reply