I have a batch EXCI program which calls a online program to update a VSAM file (basically it adds a new record in the file). Once the updation are done the control come backs to the Batch EXCI. Then I try to read the same file (which was updated online) in batch for the new record that was added. The program abends with record not found; however the record is present in the file.
My question is that whenver the batch program starts does it takes an image of the file and it considers those set of records in the program. Any external updates that happens are not considered. If this is the case, what is the best way to handle this in the same batch EXCI program.
Joined: 06 Jun 2008 Posts: 8167 Location: East Dubuque, Illinois, USA
My question is that whenver the batch program starts does it takes an image of the file and it considers those set of records in the program.
Absolutely not. What is happening to you is common -- when you do a WRITE in CICS, the data is not written to the file immediately. CICS will keep the data in the buffer until it needs the buffer for another record, or something forces CICS to write the buffer out (such as closing the file, for example).
The quickest -- and easiest -- solution for your problem is to close and reopen the file in CICS after the WRITE. Your site support group, however, may have an issue with this approach since it may take up system resources to perform the close / open. And, of course, the commands are System Programming commands and may not be available to your standard CICS compile procedure. Your best bet is to explain to your site support group what your application needs to do and get them to help with an appropriate approach.