On Thu, 16 Oct 2008 06:53:15 -0500, Walt Farrell wrote:
>
>I would write the new records into a new file and then copy the existing
>file and append its records to that new file.   After that, the exec could
>then delete the existing file and rename the new one to the old name if needed.
>
And I'll recommend z/OS Unix files.  You can omit the delete, and the
POSIX rename guarantees that no other process will observe a window
during which the file doesn't exist, and there's no need for an ENQ
with the possible lockout.  (Might the same be true with PDSE members?)

>There is an unsafe alternative: you could read all of the existing data into
>REXX variables, then write the new records to the beginning of the existing
>file, and then write the data from the variables after that new data.
>However, if an error occurs before you finish the writing then you will have
>lost the data in your file.
>
And it might actually be poorer performance.  Note that this is
effectively copying the original file to the page data set, then
the page data set back to the new file -- twice the disk I/O.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to