For Programmers: Free Programming Magazines  


Home > Archive > Cobol > May 2006 > Rewrite Twice?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Rewrite Twice?
dmckeon@ameritas.com

2006-05-31, 6:55 pm

I have a situation where I'm processing a request that comes in a
sequential file. At the end of processing, we rewrite the record so we
know processing is complete. I'm now adding some logic and want to
perform a rewrite in the middle of processing in case the program
abends in the middle, we can recover properly. Unfortunately, the
second rewrite then fails. Is there any way to rewrite a record twice
or do I need to close the file and re-read it back to the point I was
at?

I'm using Microfocus Workbench on Windows XP.

Thanks!

Binyamin Dissen

2006-05-31, 6:55 pm

On 31 May 2006 08:14:54 -0700 dmckeon@ameritas.com wrote:

:>I have a situation where I'm processing a request that comes in a
:>sequential file. At the end of processing, we rewrite the record so we
:>know processing is complete. I'm now adding some logic and want to
:>perform a rewrite in the middle of processing in case the program
:>abends in the middle, we can recover properly. Unfortunately, the
:>second rewrite then fails. Is there any way to rewrite a record twice
:>or do I need to close the file and re-read it back to the point I was
:>at?

Can you change it so that it isn't a sequential file?

Otherwise you are out of luck.

Also, be aware the issuing the WRITE does not guarantee that the record is
firmed to disk, especially when there is an abend. The record may be in a
buffer. A CLOSE will force the write. There may be other tools provided by
your COBOL.

--
Binyamin Dissen <bdissen@dissensoftware.com>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel


Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.

I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.
Rick Smith

2006-05-31, 6:55 pm


<dmckeon@ameritas.com> wrote in message
news:1149088494.470474.70070@i40g2000cwc.googlegroups.com...
> I have a situation where I'm processing a request that comes in a
> sequential file. At the end of processing, we rewrite the record so we
> know processing is complete. I'm now adding some logic and want to
> perform a rewrite in the middle of processing in case the program
> abends in the middle, we can recover properly. Unfortunately, the
> second rewrite then fails. Is there any way to rewrite a record twice
> or do I need to close the file and re-read it back to the point I was
> at?
>
> I'm using Microfocus Workbench on Windows XP.


The Byte-stream File Routines may be used or,
perhaps, a second file that contains only the ID
of the record being processed, so that only one
rewrite is required.



dmckeon@ameritas.com

2006-05-31, 6:55 pm


Rick Smith wrote:
> <dmckeon@ameritas.com> wrote in message
> news:1149088494.470474.70070@i40g2000cwc.googlegroups.com...
>
> The Byte-stream File Routines may be used or,
> perhaps, a second file that contains only the ID
> of the record being processed, so that only one
> rewrite is required.


Thanks for the input, guys. I'll just close the file and re-read it.
I just thought there might be a trick or a command that I was
unfamiliar with.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com