Updating a record in sequential file

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
sathishmca
Participant
Posts: 43
Joined: Mon Mar 03, 2008 10:58 pm
Location: Chennai

Updating a record in sequential file

Post by sathishmca »

Hi any one can you help me that i need to update a record in sequential file.

Ex:

existing record : 1 aa
new record from source is 1 bb

Now i need to update existing record(1 aa) should be change as (1 bb).

Thanks in advance..
Sathish Bhojan
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Sequential files cannot be updated like tables. In order to change a sequential file in DataStage you will need to read it and write it to another, making whatever changes you require as the data is passed through.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Sequential files can be updated like tables if you use the ODBC driver for text files with an ODBC stage. This is a particularly useful combination if you are being paid by the hour.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nsm
Premium Member
Premium Member
Posts: 139
Joined: Mon Feb 09, 2004 8:58 am

Post by nsm »

the other way I can think of is write the flat file to a hash and update the hash and finally overwrite the sequential file with Hash file.

Thanks
nsm
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

By "hash" I assume you mean "hashed file". Your "solution" could also be implemented using a database table, but it rather defeats the purpose expressed in the original question, does it not?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nsm
Premium Member
Premium Member
Posts: 139
Joined: Mon Feb 09, 2004 8:58 am

Post by nsm »

yes..I meant hashed file.

To use a database table you need to ask somebody to create a table and what I have seen is normally DBA team doesn't create tables for this purpose and the other way I could think of is what I have given.

I know its not really updating the sequential file but solves the issue.

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

Post by ray.wurlod »

So does using the ODBC driver for text file, with much less hassle.
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