How to update a sequential file

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
Emilio
Participant
Posts: 17
Joined: Wed Jan 28, 2004 2:18 pm
Location: Frederick, MD

How to update a sequential file

Post by Emilio »

Hello, :)
How can I update certain columns in a sequential file with data from another sequential file.

For example, the main sequential file would look something like this:

LoanNo, ZipCo, State, Int, Sfee, balance
456124, 21788, PA, 7.1250, .0250, 75000.00
333120, 55151, CA, 6.7580, .0250, 99000.00
122115, 31030, MD, 7.0000, .0250, 34000.00
990008, 31025, MD, 7.1250, .0250, 199000.00

The update file would look something like this:

LoanNo, Int
456124, 7.5000

In this example, only need to update colum "Int" for "LoanNo" 456124.

The main sequential file would have a LoanNo column and many other static columns. The update fiele will always have a LoanNo column and the columns with the data that need to update the main sequential file...so, the update sequential file could have one or more columns to update the main sequential file..... The update sequential file would have one or many rows.....
The "LoanNo" column will always be on both files.

Any suggestions will be appreciated!!

Thx,
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Since positioning in a sequential file is not a good idea or practicable, you will need to process your data by reading through the source into a copy, modifying those records that have changed; then renaming your new file to overwrite the old.

Since this is a column update, just about any database including the hashed files will do this for you.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can use the ODBC driver for text files. Just don't complain about the performance, which will be horrible.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Emilio
Participant
Posts: 17
Joined: Wed Jan 28, 2004 2:18 pm
Location: Frederick, MD

Post by Emilio »

Thank you for the feedback :D , this gives me a good start.
As far as loading the main sequential file into a table; does Ascential have a way to store its own tables (I thought that was metadata all about).
Or could you do it into an Microsoft Access table? How about a Hashed file? which way would be a more efficient way to do it?
I don't have access to a SQL or oracle table to use.
Thnx,
Rod :)
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
The closest thing is hash files but I would vote against it (for several reasons).
If you want to store the data in the files go for DB or archiving system, which ever sutes your needs the best.

Actually you'll find processing sequential files is quite fast, so if FTPing them to the dS erver if you need to.

IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
Emilio
Participant
Posts: 17
Joined: Wed Jan 28, 2004 2:18 pm
Location: Frederick, MD

Post by Emilio »

Okay, looks like loading a sequential file into a hashed file is not such a good idea.....
Can I load it into an Access Database? :?:
Doesn't Ascential provide a way to store tables from within itself?
:?: (Pardon my ignorance if I don't know what I am talking about Ascential) :oops:
Emilio
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

The hash files are probably a perfect method for what you need to do. Slam your file into a hash file, then parse it at need, referencing rows when necessary, adding rows, updating exist, etc, dump it back to a sequential file.

What's the big deal?
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Post Reply