Joined: 05 Oct 2005 Posts: 347 Location: Vizag / US
I have posted the Doc, but it is missing....
no probs , here is the reasons...
Reason why we go for DB2 instead of VSAM files:
? Refferential Integrity.
? Structured
? Backup and Recovery is very easy.
? Data integrity /Consistent is very good.
? Logging for Commit and Rollback.
Refferential integrity is nothing but when we have two tables an entry in the child table can be made for the primary key value available in the parent table else the insert operation will fail.
Having columns and other features it becomes structured.
Backup and recovery process are simpler though they have to be taken care in the application program.
Avoid duplicating etc
Logging is nothing but maintaining the before image and after image of the transactions/records to enable rollback and commit process.
Whenever the sqlcode is ?ve then the previous operations has to be rolledback, for this we check the sqlcode and issue Exec sql rollback end-exec. In these scenarios, the program has to be restarted and it has to be started from the point where the abend was, this has to be handled in the program only.
The point from where the rollback has to be enabled will be identified by updating the table with the key value whenever a commit is performed. This table has to be created by the user and the coding has to be done in the program to update this table with the key value whenever a commit statement is updated, so incase of rollback this will help in identifying from which point the data has to be rolledback.