What if the File Formats changes

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
samunik
Premium Member
Premium Member
Posts: 10
Joined: Fri Oct 08, 2004 11:10 am
Location: USA

What if the File Formats changes

Post by samunik »

hi there

i am relatively new over here, i have come across a very unique problem. what if the format of the sequential file which i read from the remote side changes, for example if i get like 90 coloums today, there is a chance tommorow i can get 95 or 85.

is there a work around for this situation or its not possible in DS.
Any buyers?
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Handled such scenario several times. You can handle these situations by various methods using DataStage.

One simple method is to define the whole record as a single field and split it depending on the requirement.

Other is to accept file with incomplete columns.

But the main question is - if you have different number of columns, how can you know which value represents which field? Will it be part of the data or will you have some logic to derive it.
memrinal
Participant
Posts: 74
Joined: Wed Nov 24, 2004 9:13 pm

Post by memrinal »

I faced similar situation where a single file contained some records with X columns, some with Y and ome with Z columns. I had to move the reocrds of different schema into different files.
so i kept a special character as the field delimiter, read the whole record as field and then dependign on the number of delimiters (the ones on which the file was really delimited) the main file was split into different files. however i could do this as i knew taht if it has X columns then which column is what and if it has Y columns then which comuns is what.

So as Sai said you must know which value reprensents which field.
samunik
Premium Member
Premium Member
Posts: 10
Joined: Fri Oct 08, 2004 11:10 am
Location: USA

Post by samunik »

well actually i tell you the whole scenario, i am suppose to get the payment schedule of a Customer, now a customer can be in any month of his lease, what the front end does, is sends me a record of the persons information with his payment history too.

so the no. of coloums keep fluctuating. i suggested to create a new file format, bu the frontend guy is like thats the way we do it.
sachinkc
Participant
Posts: 34
Joined: Sat Apr 17, 2004 11:39 am
Location: USA

Post by sachinkc »

I think someone will definately need atleast the field in the database table to which the column (85th or 95th) will go to, to figure out how to read the inbound data.

May be you can try to see how they were fetching all the columns in their fields before they got DataStage and probably try to use that same logic.

Sachin
samunik wrote:well actually i tell you the whole scenario, i am suppose to get the payment schedule of a Customer, now a customer can be in any month of his lease, what the front end does, is sends me a record of the persons information with his payment history too.

so the no. of coloums keep fluctuating. i suggested to create a new file format, bu the frontend guy is like thats the way we do it.
Rgrds & Cheers!

Sachin
sachin@operamail.com
~Life always finds a way~
Post Reply