Page 1 of 1

How to update a sequential file

Posted: Wed Oct 26, 2005 12:28 pm
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,

Posted: Wed Oct 26, 2005 12:36 pm
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.

Posted: Wed Oct 26, 2005 5:20 pm
by ray.wurlod
You can use the ODBC driver for text files. Just don't complain about the performance, which will be horrible.

Posted: Thu Oct 27, 2005 5:47 am
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 :)

Posted: Thu Oct 27, 2005 5:55 am
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,

Posted: Tue Nov 01, 2005 2:57 pm
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

Posted: Tue Nov 01, 2005 3:01 pm
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?