Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 14: CICS Performance, Security and Advanced Topics


CICS Performance

CICS performance means how fast transactions respond to users and how many transactions the region can handle at the same time. Good performance keeps response time low even when hundreds of users are active.

What decides CICS response time

  • Response time is the time from pressing Enter on the terminal to the next screen appearing.
  • It includes terminal network time, program execution time, file and database I/O time, and waiting time for locks or storage.
  • A slow transaction is usually slow because of waiting, not because of CPU work. Find out what it is waiting for.
  • Set a response time goal for each important transaction and measure it regularly.

Where to tune first

  • Tune the application program first. One bad program design can hurt more than any system setting.
  • Read only the records you need. Do not read a whole file to find one record.
  • Use pseudo-conversational programming so CICS does not hold resources while the user is thinking.
  • Keep VSAM files well organized. Reorganize files that have many inserted records and check the buffer settings.
  • For DB2, use proper indexes, avoid full table scans, and commit work regularly to release locks.
  • Use GETMAIN storage carefully and free storage you no longer need.

System level tuning

  • Set MAXTASKS high enough so real work is not rejected, but not so high that the region runs out of storage.
  • Keep frequently used programs and maps resident in memory so CICS does not load them again and again.
  • Use multiple regions (MRO) to split terminal handling, application work, and file work across regions.
  • Write threadsafe programs so work can run on open TCBs instead of queuing for the single QR TCB.

Example: measuring transaction response time

  • You can measure how long your transaction takes with EXEC CICS ASKTIME. Store the time at the start and at the end, then compare.
  • WORKING-STORAGE SECTION. 01 WS-START-TIME PIC S9(15) COMP-3. 01 WS-END-TIME PIC S9(15) COMP-3. 01 WS-ELAPSED PIC S9(15) COMP-3. PROCEDURE DIVISION. EXEC CICS ASKTIME ABSTIME(WS-START-TIME) END-EXEC. * --- main transaction logic goes here --- EXEC CICS ASKTIME ABSTIME(WS-END-TIME) END-EXEC. COMPUTE WS-ELAPSED = WS-END-TIME - WS-START-TIME. IF WS-ELAPSED > 200000 EXEC CICS WRITEQ TD QUEUE('SLOWTRAN') FROM(WS-ELAPSED) LENGTH(8) END-EXEC END-IF.
  • ABSTIME returns time in milliseconds since 1900, so the difference is the elapsed time in milliseconds.
  • Log slow transactions to a queue or file, then investigate them with monitoring and trace data.





© copyright mainframebug.com
Privacy Policy
MainframeBug Assistant