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

Module 1: CICS Introduction


What is CICS?

CICS is middleware. It is the layer of software that connects users, application programs and data on a mainframe, so that business transactions happen online, immediately, and safely.

CICS in simple words

  • Think of CICS as a very efficient waiter in a busy restaurant. Hundreds of customers (users) order at the same time, and the waiter makes sure every order reaches the kitchen (programs and data) and every dish comes back to the right table.
  • Technically, CICS is an Online Transaction Processing (OLTP) system.
  • It manages communication, programs, files, security and recovery, so the application program contains only business logic.

Online Transaction Processing (OLTP)

  • A transaction is a small unit of work, for example one balance enquiry or one ticket booking.
  • Online means the work happens immediately, while the user waits at the terminal.
  • CICS can handle thousands of such transactions every second with response times of a second or two.
  • Every transaction is independent. If one fails, the others are not affected.

What CICS does for your program

  • Terminal communication - sends screens to users and reads what they type.
  • Program management - loads your program into memory when it is needed.
  • Data access - reads and writes VSAM files, DB2 tables and queues on your behalf.
  • Task management - runs many users at the same time without them disturbing each other.
  • Security - checks who the user is and what they are allowed to do.
  • Recovery - keeps journals and logs so work can be recovered after a failure.

How a CICS program is different

  • A CICS program cannot use COBOL DISPLAY, ACCEPT or file I/O verbs. It must use EXEC CICS commands for everything.
  • Example - reading a customer record in CICS:-
    EXEC CICS READ FILE('CUSTMAS') INTO(WS-CUSTOMER-REC) RIDFLD(WS-CUST-NUM) RESP(WS-RESPONSE) END-EXEC. IF WS-RESPONSE NOT = DFHRESP(NORMAL) EXEC CICS SEND TEXT FROM('CUSTOMER NOT FOUND') END-EXEC END-IF.
  • Note:- RESP(WS-RESPONSE) catches the result of the command, and DFHRESP(NORMAL) means the read worked. You will see this pattern in almost every CICS program.
  • CICS programs must be quasi-reentrant, which simply means many users can safely share one copy of the program in memory.





© copyright mainframebug.com
Privacy Policy
MainframeBug Assistant