as the files you are using do not have the concept of transaction, only way you are going to achieve that issue is to flag the records with a "temporary processed" flag.
example
e.g. first time you process the records you mark them with "pass 1" and you do all the normal processing required on those records. Eventually you write a unique identifier of that record into another file for later processing.
Process all required records on the file.
At the end if the program has not abended, update that flag in all records with "pass 2"
If it has abended, then you go through each record flagged as "pass 1" and undo any changes you may have done.
Its tricky, it may require support files to be written, will be slow. but you will be able to get the data as you wish.
In my opinion if the file you are processing is a ALL or NOTHING and this is being done during the day with other users online (as it seems to be the case), then probably the usage of that file should be rethought.
Regards
Frederico Fonseca
SysSoft Integrated Ltd
FAQ219-2884
FAQ181-2886