HP3000-L Archives

June 1997, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Roy Brown <[log in to unmask]>
Reply To:
Roy Brown <[log in to unmask]>
Date:
Wed, 11 Jun 1997 12:03:53 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (52 lines)
In article <[log in to unmask]>, Jerald Burnett
<[log in to unmask]> writes
>Efren Castro wrote:
>>
>> Im still working on the year 2000 project. Im doing a serial read using
>> cobol, to update the date fields. To update critical items I delete the
>> record then write the record using the updated fields.  The problem is
>> that I lose my key so when it goes to read serial again it gives me a
>> end of file error.  How can I retain my place after doing a dbput and
>> not lose my key for the next serial read ?
>
>I had some of the same problems on a system that we recently converted.
>I finally did an unload to disk (using DB2DISK), made the date
>modification using editor and then reloaded the data into the database
>(using DISK2DB).  With most any other method, records are very likely to
>migrate to other physical locations as you progress through the serial
>read.

Try this.

(i)  DBCLOSE Mode 3 to ensure you are at the start of the dataset.

(ii) Read the dataset serially. On encountering a record you wish to
     process, store its direct record number (CURR-DIR-REC).
     If EOF occurs first, exit.

(iii)Process the entry as you wish, except that you write the 'new'
     entry and don't delete the 'old' entry yet.

(iv) This will allow you to rewrite any detail chains hanging off the
     'old' key onto the 'new' key. (Doesn't sound like you need this,
     but somebody might).

(v)  Now make a directed read on CURR-DIR-REC,
     delete the entry
     and repeat from (ii).

You are enjoined to make the records you are rewriting distinguishable
in some way, so that you do not reprocess them as you encounter them
further down the file in their new locations.

OR:

Why not just turn CIUPDATE on on the database in question, and use
DBUPDATE? I know this won't work for Master set chain heads, but if you
have those you have
--
Roy Brown               Phone : (01684) 291710     Fax : (01684) 291712
Affirm Ltd              Email : [log in to unmask]
The Great Barn, Mill St 'Have nothing on your systems that you do not
TEWKESBURY GL20 5SB (UK) know to be useful, or believe to be beautiful.'

ATOM RSS1 RSS2