Basic Terminology


Understanding key terminologies in CICS is important for effectively developing and managing applications within this transaction processing system. Below is a detailed explanation of fundamental CICS concepts useful for beginners:

Conversational Programming -


Conversational programming involves keeping a program active and waiting for user input during its execution. The system maintains the program in memory throughout the interaction, similar to a back-and-forth conversation.

Key Points:

  • The program sends a message to the user and waits for a response before proceeding to the next step.
  • Since the program occupies system resources during the user's "think time", it can lead to resource bottlenecks.

Example: An airline reservation system prompts the user for flight details and waits for input. The program remains active until the user completes the input.

Pseudo-Conversational Programming -


Pseudo-conversational programming optimizes conversational programming by releasing resources during user think time. This approach enhances system performance and scalability.

Key Points:

  • The program sends a message and terminates, specifying the next transaction to start upon user response.
  • When the user responds, CICS restarts the program, passing the context to resume from the last step.

Benefits:

  • Frees up resources for other tasks during idle periods.
  • Improves overall system efficiency and supports more users.

Example: A banking application prompts for account details, ends the task, and resumes when the user inputs the required information, ensuring no resources are wasted during the wait.

Task -


A task in CICS is a single instance of work created when a user initiates a transaction by entering a Transaction Identifier (TRANID). Each task runs independently under the control of CICS and executes the associated program(s) until completion.

Key Points:

  • A task begins when a transaction is invoked and ends when the program completes or control returns to CICS.
  • Tasks can pause, wait for events like user input or file access.
  • CICS can handle multiple tasks simultaneously through multitasking, providing efficient resource utilization.

Example: A user enters BAL1 to perform a balance inquiry. CICS creates a task, executes the associated program, and retrieves the account balance. Once completed, the task ends.

Multitasking -


Multitasking refers to an operating system's ability to execute multiple tasks simultaneously, whether those tasks involve the same program or different ones. CICS manages multitasking within its own region, creating an environment where several CICS tasks can run concurrently. This means that CICS can handle multiple user requests at the same time, enhancing the system's efficiency and responsiveness.

Key Points:

  • Tasks that are idle (e.g., waiting for user input or I/O operations) allow other tasks to use system resources.
  • CICS uses a dispatcher to prioritize and schedule tasks, ensuring critical operations are processed promptly.

Example: While one task processes a loan inquiry, another task retrieves account details for a different user without waiting for the first task to finish.

Non-reentrant Program -


A non-reentrant program is the program does not modify itself during execution, can't allowed to re-enter to continue processing after an interruption, such as a Supervisor Call (SVC) in the operating system.

Example: All Batch programs are non-reentrant programs in mainframe.

Reentrant Program -


A reentrant program is designed to be safely executed by multiple tasks concurrently without interfering with each other. This is achieved by ensuring that the program does not modify itself during execution, allowing it to re-enter and continue processing after an interruption, such as a Supervisor Call (SVC) in the operating system.

Key Points:

  • The program's code remains unchanged during execution, preventing conflicts between concurrent tasks.
  • Multiple tasks can share the same copy of the program in memory, reducing resource consumption.
  • Each task maintains its own set of data, ensuring that concurrent executions do not interfere with each other.

Example: A currency conversion program that multiple tasks use concurrently to calculate exchange rates for different transactions.

Quasi-Reentrant Programs -


A Quasi-reentrant program is a reentrant program that is executing in CICS environment. A quasi-reentrant program in CICS is one that can safely be used by multiple tasks, even though CICS may interrupt and resume tasks in a manner that doesn't align with traditional reentrancy models.

CICS obtains a separate copy of working storage for each execution of an application program to ensure that programs cannot interfere with each others working storage. Quasi-reentrancy allows programs to access globally shared resources.

Example: A program that processes customer order requests in an e-commerce system, handling interruptions due to other high-priority tasks.

Multithreading -


Multithreading is a subset of multitasking where multiple tasks share the same program code. It ensures that a single copy of a program can serve multiple tasks concurrently.

Key Points:

  • A single copy of a program resides in memory and is reused by multiple tasks, reducing resource overhead.
  • Programs must be reentrant (or quasi-reentrant in CICS) to allow safe concurrent execution.

Example: A tax calculation program can handle multiple tax computations for different users simultaneously, provided the program is reentrant.