We are running IBM's Check Processing Control System (CPCS) which is written in Cobol & Assembler. CPCS calls Control Machine (CTMC) which is a Conix product also written in Cobol & Assembler. CPCS captures check data and CTMC posts, balances, etc. These programs run as tasks in an on-line region where many users can correct captured check MIRC data and post/balance the entries. The main module of CTMC is a COBOL program DKNCTMC which we have source code for and have added user code. I have made changes to this module to total item counts per entry on the Interface Master file and write them to a VSAM file for use in redisplaying on the screen and reporting at end of day. I am using ENQ/DEQ to lock my VSAM file record during reads, writes and rewrites. The ENQ/DEQ processing is not retuning any non-zero return codes and when one (1) user is in CTMC my code changes are working great. We have even expedited the code and all appears to function correctly. However, when multiple users are in CTMC there appears to be contention issues even though I should have the record locked for 1 user. For example, if one user scrolls the list of enties he will see the item count totals display, if at the same time another user scrolls the list of entries, he will see zeroes. Also, when writting or rewritting to the VSAM file which happens at posting time, if multiple users are trying to post at the same time we are getting VSAM errors even thou they are posting different entries (records). These errors cause the data not to be written to the VSAM file. In my sysout I see the message: ITEMCNT WRITE/REWRITE ERROR 93; ITEMCNT is my VSAM file DDNAME used in my display message and 93 is the VSAM file status. Based on the VASM messages a 93 is a resource unavailable. We took out the ENQ/DEQ code and got the same results. So obviously the ENQ/DEQ is not doing its job. The VSAM file is defined as KSDS with a key of 17, share options (2,3) reuse (No). Since only 1 person can expedite at a time, we can not recreate the contention where we can view the exact sequence of events. We have used the ENQ/DEQ in other programs successfully, why it is not working in DKNCTMC is unknown.
Please advise - Is there a better way to test or a better method to lock the records. What we want is for users to be able to read/display information to the screen with no contention - if one record is locked for update, skip over it and display the rest and keep going without abending. And for users to be able to lock different records for update at the same time. If the record is locked and a user displays a list, again skip the locked record and get the rest without abending. If a user tries to lock a record already locked - send them a record in use message.
May 17, 2010 8:35 PM
July 28, 2010 5:23 PM