Olga wrote:
Hi!
I have a problem: if while execution of a programm happens an abend,
all the data from the output-VSAM file dessapears.
Why does it happen? How can i avoid this situation and save data,
already printed in the output file?
What happens on an ABEND greatly depends on the internals of your
program and the nature of the failure. Writing a logical record to a
VSAM file, or to a sequential file for that matter, only puts the
logical record into buffers within your address space. For reasons of
efficiency it does not wait on physical writes to the data set. The
physical writes to an external data set generally occur asynchronously
with program execution at times of the access method's choosing,
typically when multiple buffers are ready for transfer or when it is
running short of buffers. The only time you are completely guaranteed
that all requested writes have completed is when a CLOSE is requested on
the file and it successfully completes. If your program blows up in a
way that bypasses the CLOSE of your output datasets, especially if it
runs amok in a way that corrupts the file's in-memory control blocks or
buffers, you can potentially loose everything stranded in the buffers
waiting to be written. Under some circumstances the Operating System can
manage to do auto-closes on open datasets when a program ABENDs, but you
cannot depend on this. Having larger blocksizes (CISIZE in VSAM) and a
greater number of buffers, may improve run-time efficiency, but can also
increase the number of records that are exposed to loss in the event of
a program ABEND.
A program should be designed to do the necessary data validation checks
and checks for abnormal file status so that it does NOT terminate in an
uncontrolled manner. An uncontrolled termination always means that the
effects on asynchronous activities in-flight are unpredictable.
If records have been successfully written to a VSAM data set but it was
not properly closed, running a VERIFY on the dataset may restore it to
some semblance of functionality. Records that were never physically
written to the dataset are simply lost.
--
Joel C. Ewing, Fort Smith, AR [EMAIL PROTECTED]
----------------------------------------------------------------------
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