I was asked that what will be the logic or what can be doen if a program abended and it was processing a VSAM file which is haveing 10000 records and it abended after reading and processing .then how will u start from the record it abended. Sir i am not geting write material to be good in vsam batch processing. plz send me some document if u have.
I think you have control in the code itself.What i feel is keep/store the key in a data item as the records processed, but write in separate file if the job gets abended i.e the current key otherwise write default value if the job completes successfully.
If the codes reads default value in the next run maintain the logic as it runs normally other wise goto the specific key and continue processing..
Code the program which reads the input file to have logic
1. Read an existing RESTART file which can be defined as VSAM access mode dynamic, optional (i.e. the file can be present or not present based on which iteration the step is running for)
2. If RESTART file is not present, read the input file from start.
3. If RESTART file is present, read the record from RESTART file.
4. Read record from INPUT file with START browsing at INFILE-KEY > RESTART-KEY.
5. Every time you read a record from input file, overwrite RESTART file's first record(Note that RESTART file will have only one record at a time).
Step5 will make sure that record at which it abended is stored in RESTART file and is avoided the next time in step 4.
if u don't want to chnge the logic in the progarm.Update the jcl such a way take a backup of the vsam file before executing the program.If the program abendd just restore the vsam file from the backup flat file or gdg and submit the job again
thanks jai for suggesting but i want to do it automatically i dont know the syntax for restart check point i am asking in that way. plz do repply me with actual syntax.
thanks
navneet