IBM CICS (Customer Information Control System): A Guide to Mainframe Transaction Processing
This guide explores IBM's CICS (Customer Information Control System), a mainframe-based online transaction processing (OLTP) system. Learn about its primary functions, key components like the PPT (Processing Program Table), and understand its role in building high-throughput, reliable business applications for banking, order processing, and other enterprise tasks.
CICS Interview Questions and Answers
What is CICS?
Question 1: What is CICS?
CICS (Customer Information Control System) is an online transaction processing (OLTP) system from IBM. It's used for developing and running business applications on mainframes, facilitating the processing of transactions such as banking, order processing, and other business tasks that are performed online. It's designed for high-throughput, reliable transaction processing.
PPT (Processing Program Table)
Question 2: PPT (Processing Program Table)
The PPT (Processing Program Table) in CICS contains information about programs, including program name, mapset name, language, size, and storage location.
Primary CICS Function
Question 3: Primary Aspect of CICS
CICS is primarily used for building and managing online transaction processing (OLTP) applications. It offers efficient database access, terminal communication, and formatted data handling.
Integrated CICS Translator
Question 4: Integrated CICS Translator
The Integrated CICS translator is used for compiling programs containing embedded CICS commands. It interfaces with a COBOL or other language compiler to handle the CICS statements and generate the appropriate code.
CICS Job Priority
Question 5: CICS Job Priority
CICS itself is treated as a high-priority batch job by the underlying operating system.
Accessing Date and Time
Question 6: Getting Date and Time in CICS
The `ASKTIME` command retrieves the current date and time.
`CALL` vs. `LINK` in CICS
Question 7: `CALL` vs. `LINK` in CICS
Differences:
Command | Behavior |
---|---|
CALL |
Calls a subroutine; changes in the called program require recompilation of the calling program. |
LINK |
Passes control to another program; changes in the linked program do not typically require recompilation of the calling program. |
TCT and RCT
Question 8: TCT and RCT
In CICS:
- TCT (Terminal Control Table): Contains information about terminals connected to CICS.
- RCT (Resource Control Table): Contains information about DB2 resources.
Skipper and Stopper Fields
Question 9: Skipper and Stopper Fields
In CICS, `ASKIP` is often used as the attribute value for the Skipper field, and `PROT` for the Stopper field.
PCT and FCT
Question 10: PCT and FCT
In CICS:
- PCT (Program Control Table): Maps transactions to programs.
- FCT (File Control Table): Defines files accessible to CICS applications.
Releasing Records
Question 11: Releasing Records
The command `EXEC CICS UNLOCK RECORD ... END-EXEC` releases an exclusive lock on a record.
`START` vs. `XCTL`
Question 12: `START` vs. `XCTL`
Differences:
Command | Type | Task Handling |
---|---|---|
START |
Task control | Initiates a new task |
XCTL |
Program control | Transfers control within the same task |
BMS (Basic Mapping Support) Options
Question 13: BMS Options
BMS options in CICS: Minimum, Standard, Full.
MDT Option
Question 14: Setting MDT Option
You can set the MDT (Map Data Table) option to 'ON' even without data entry using the FSET option in DFHMDF or dynamically in the program using the FIELD+A attribute.
CICS Tasks
Question 15: CICS Tasks
A CICS task is a unit of work initiated by a transaction. It runs until it completes and returns control to CICS.
`EXEC CICS HANDLE CONDITION`
Question 16: `EXEC CICS HANDLE CONDITION` Command
This command specifies how to handle conditions (errors) that may occur during program execution. It directs control to a specific paragraph or section of code to handle the error.
Important CICS Programs
Question 17: Important CICS Programs
Important CICS control programs:
- TCP (Terminal Control Program)
- KCP (Task Control Program)
- PCP (Program Control Program)
- FCP (File Control Program)
- SCP (Storage Control Program)
CEMT (CICS Execute Master Terminal)
Question 18: CEMT
CEMT is used for monitoring and managing CICS resources (transactions, tasks, files, programs).
BMS (Basic Mapping Support)
Question 19: BMS (Basic Mapping Support)
BMS is used to define and manage screen layouts (maps) in CICS applications.
CICS Control Programs
Question 20: CICS Control Programs
CICS control programs manage various aspects of CICS operations. These programs handle terminal communication, task management, program execution, file access, and storage allocation.
CICS Control Tables
Question 21: Important CICS Control Tables
Important tables:
- TCT (Terminal Control Table): Defines terminals connected to CICS.
- PCT (Program Control Table): Maps transactions to programs.
- PPT (Processing Program Table): Contains program information.
- FCT (File Control Table): Defines files.
Cursor Attributes
Question 30-32: Cursor Attributes
Cursor attributes provide information about the state and results of cursor operations:
SQL%ROWCOUNT
: Number of rows affected.SQL%FOUND
: True if at least one row was fetched.SQL%NOTFOUND
: True if no rows were fetched.%ISOPEN
: Checks if the cursor is currently open.
PL/SQL Packages
Question 33: PL/SQL Packages
PL/SQL packages group related program units (procedures, functions, variables, cursors) into a logical unit, improving code organization and reusability.
Package Structure
Question 34: Parts of a PL/SQL Package
Two parts:
- Specification: Public interface (what's visible to other programs).
- Body: Implementation details.
Deleting a Package
Question 35: Deleting a PL/SQL Package
Use the `DROP PACKAGE` command to delete a package.
Executing Stored Procedures
Question 36: Executing Stored Procedures
Use the `EXECUTE` or `EXEC` command (or just call the procedure name directly).
Advantages of Stored Procedures
Question 37: Advantages of Stored Procedures
Benefits:
- Modularity
- Reusability
- Performance improvement (precompilation)
- Data security
Counting Table Rows
Question 34: Counting Table Rows
SQL
SELECT COUNT(*) FROM TAB;
Maximum Length of CHAR and VARCHAR
Question 35 & 36: Maximum Length of CHAR and VARCHAR
Maximum lengths in DB2:
CHAR
: 254 bytesVARCHAR
: 4046 bytes
CICS Control Tables
Question 21: Important CICS Control Tables
CICS uses control tables to manage resources and configurations. Key tables:
- TCT (Terminal Control Table): Defines terminals connected to CICS.
- PCT (Program Control Table): Maps transactions to programs.
- PPT (Processing Program Table): Contains program information (storage location, size, etc.).
- FCT (File Control Table): Defines files used by CICS applications. Files used by CICS applications are listed here, and they are opened and closed by CICS itself.
COMMAREA (Communication Area)
Question 22: COMMAREA (Communication Area)
COMMAREA is a shared memory area used to pass data between CICS programs. It's a temporary storage location for data exchange within the same transaction. The maximum size of data that can be passed is 32KB.
EXEC Interface Block (EIB)
Question 23: EIB (EXEC Interface Block)
The EIB (EXEC Interface Block) is an area automatically loaded by CICS. It contains system information (like transaction ID, response code, timestamp) that you can access in your CICS programs.
CICS Transactions
Question 24: CICS Transactions
A CICS transaction is a unit of work initiated by a user request. Each transaction can execute a specific task. It's identified by a four-character code (Transaction ID or TRANSID) and typically involves interacting with CICS resources (like programs and files).
Task vs. Transaction
Question 25: Task vs. Transaction
A transaction can be invoked by multiple users; each user interaction creates a separate task.
`EXEC CICS RETURN` and TRANSID
Question 26: `EXEC CICS RETURN` with TRANSID
Including the `TRANSID` in the `EXEC CICS RETURN` command specifies the transaction to be executed when the user presses the attention key next.
CICS Programs
Question 27: Commonly Used CICS Programs
CICS control programs:
- Terminal Control Program (TCP)
- Task Control Program (KCP)
- Program Control Program (PCP)
- File Control Program (FCP)
- Storage Control Program (SCP)
EIBRCODE Field
Question 28: EIBRCODE Field
The `EIBRCODE` field in CICS's EIB (EXEC Interface Block) contains a response code indicating the success or failure of a CICS command.
Creating Maps with BMS (Basic Mapping Support)
Question 29: Creating Maps in CICS
BMS (Basic Mapping Support) in CICS helps to define screen layouts:
DFHMDF
: Defines individual fields on a map.DFHMDI
: Defines a map.DFHMSD
: Defines a mapset.
Transaction IDs (TRANSIDs)
Question 30: TRANSIDs
A TRANSID (Transaction ID) is a four-character code used to start a CICS transaction.
`EXEC CICS RECEIVE MAP`
Question 31: `INTO` vs. `SET` in `EXEC CICS RECEIVE MAP`
Differences:
INTO
: Copies map data into a specified storage area.SET
: Returns the address of the map data area.
DFHMDF Attributes
Question 32: DFHMDF Attributes
Attributes defined using DFHMDF (for defining individual fields on a CICS map):
POS
(position)ATTRB
(attributes)LENGTH
INITIAL
PICOUT
GRPNAME
OCCURS
EIB Block Fields
Question 33: Important EIB Fields
Important fields within the EIB (EXEC Interface Block):
EIBCALEN
(calendar date)EIBRESP
(response code)EIBTASK
(task number)EIBRCODE
(return code)EIBTIME
(time)EIBDATE
(date)
Dynamic Calls in CICS
Question 34: Dynamic Calls
Dynamic calls in CICS allow for calling programs that are not known at compile time. This increases flexibility and allows you to build applications that adapt to changing environments or requests.
PF and PA Keys
Question 35: PF and PA Keys
Differences:
- PF (Program Function) key: Initiates data transmission on `RECEIVE MAP`.
- PA (Program Attention) key: Does not initiate data transmission.
MDT Option (Continued)
Question 36: Setting MDT Option (Continued)
Set the MDT (Map Data Table) option to 'ON' even without data entry by specifying `FSET` in `DFHMDF` or by setting it dynamically in your program.
Terminating Transactions
Question 37: Terminating Transactions
Use `EXEC CICS SYNCPOINT` to commit a transaction and release locks. Use `EXEC CICS RETURN TRANSID(transid)` to return to the user and specify a new transaction to run.
`SEND MAP` Commands
Question 38: `SEND MAP MAPONLY` vs. `SEND MAP DATAONLY`
Differences:
SEND MAP MAPONLY
: Sends only the map (layout); used for initial screen displays.SEND MAP DATAONLY
: Sends only updated data; the screen layout is not re-sent.
CICS Service Transaction (CEDA)
Question 39: CEDA (CICS Execute Master Terminal)
CEDA is a CICS transaction used to access and manage various CICS control tables.
`XCTL` vs. `START`
Question 40: `XCTL` vs. `START`
Differences:
XCTL
: Transfers control to another program within the *same* task.START
: Initiates a *new* task.
Mapsets
Question 42: Mapsets
A mapset in CICS is a collection of maps (screen layouts) that are loaded together as a single module.
`ENQ` and `DEQ`
Question 43: `ENQ` and `DEQ`
ENQ
(Enqueue) and DEQ
(Dequeue) are CICS commands used for resource control and synchronization. They allow multiple applications to coordinate access to shared resources, preventing data corruption and ensuring consistency. ENQ
requests control of a resource, while DEQ
releases that control.
What is CICS?
Question 1: What is CICS?
CICS (Customer Information Control System) is an IBM mainframe transaction processing monitor. It's used to build and run online business applications that handle large numbers of transactions concurrently.
PPT (Processing Program Table)
Question 2: PPT (Processing Program Table)
The PPT (Processing Program Table) in CICS contains information about programs and their associated resources (maps, files, etc.). This table is essential for program execution.
Primary CICS Function
Question 3: Primary Function of CICS
CICS's primary purpose is to handle online transactions. It provides efficient access to databases and files and manages communication with terminals.
Integrated CICS Translator
Question 4: Integrated CICS Translator
The Integrated CICS translator handles CICS commands embedded within application programs (e.g., COBOL programs). It generates the necessary code to interact with CICS during compilation.
CICS Job Priority
Question 5: CICS Job Priority
CICS transactions run with high priority in the operating system.
ASKTIME Command
Question 6: `ASKTIME` Command
The `ASKTIME` CICS command retrieves the current system date and time.
`CALL` vs. `LINK`
Question 7: `CALL` vs. `LINK` Commands
Differences:
Command | Control Flow | Recompilation |
---|---|---|
CALL |
Subroutine call | Changes in the called program require recompilation of the calling program. |
LINK |
Passes control to another program. | Changes in the linked program do not require recompilation of the calling program. |
TCT and RCT
Question 8: TCT and RCT
In CICS:
- TCT (Terminal Control Table): Defines characteristics of terminals connected to CICS.
- RCT (Resource Control Table): Defines DB2 resources available to CICS.
Skipper and Stopper Attributes
Question 9: Skipper and Stopper Attributes
The Skipper and Stopper fields are used in CICS map handling (often using `ASKIP` and `PROT` values respectively).
PCT and FCT
Question 10: PCT and FCT
In CICS:
- PCT (Program Control Table): Maps transactions to programs.
- FCT (File Control Table): Defines files used by CICS applications.
UNLOCK RECORD Command
Question 11: `UNLOCK RECORD` Command
The `EXEC CICS UNLOCK RECORD` command releases an exclusive lock on a database record.
`START` vs. `XCTL` Commands
Question 12: `START` vs. `XCTL` Commands
Differences:
Command | Function |
---|---|
START |
Initiates a new task. |
XCTL |
Transfers control to another program within the same task. |
BMS (Basic Mapping Support)
Question 13: BMS Options
BMS (Basic Mapping Support) options: Minimum, Standard, Full.
MDT Option
Question 14: Setting MDT Option
The MDT (Modified Data Tag) option in CICS indicates whether data in a map has been changed. You can set it using `FSET` in `DFHMDF` or dynamically in your program.
CICS Tasks
Question 15: CICS Tasks
A CICS task represents the execution of a transaction. Each user interaction creates a separate task.
`EXEC CICS HANDLE CONDITION`
Question 16: `EXEC CICS HANDLE CONDITION` Command
This command specifies the error-handling routine to be called if a specified condition occurs.
CICS Programs
Question 17: Important CICS Programs
Key CICS programs:
- TCP (Terminal Control Program)
- KCP (Task Control Program)
- PCP (Program Control Program)
- FCP (File Control Program)
- SCP (Storage Control Program)
CEMT (CICS Execute Master Terminal)
Question 18: CEMT
CEMT is a CICS transaction used for monitoring and controlling CICS resources.
BMS Maps
Question 19: BMS Maps
BMS (Basic Mapping Support) is used to define screen layouts (maps) for CICS applications. A mapset is a collection of maps.
ENQ and DEQ
Question 43: `ENQ` and `DEQ`
(This would require an explanation of `ENQ` (enqueue) and `DEQ` (dequeue) commands, which are used for resource synchronization in CICS.)
`XCTL` vs. `LINK`
Question 44: `EXEC CICS XCTL` vs. `EXEC CICS LINK`
Differences:
Command | Control Flow |
---|---|
XCTL |
Transfers control; doesn't return. |
LINK |
Transfers control; returns control to the calling program. |
`NEWCOPY` in CICS
Question 45: `NEWCOPY` in CICS
The `NEWCOPY` option is used when a program needs a fresh copy of a map or data area, especially when dealing with multiple executions of the same program. This is often necessary to avoid data corruption or conflicts.
`OCCURS` in BMS Maps
Question 46: `OCCURS` in BMS Maps
The `OCCURS` clause in BMS is used to define repeating fields (arrays) within a map. This can simplify defining maps with multiple similar fields.
Terminal ID Registration
Question 47: Terminal ID Registration
Terminal IDs are registered in the Terminal Control Table (TCT).
CICS Code in Copybooks
Question 48: CICS Code in Copybooks
CICS commands can be included in copybooks, but recompilation is required when changes are made to the copybook.
Symbolic Map Storage
Question 49: Storage Determination in Symbolic Maps
For multiple maps, storage is determined by the size of the largest map. The largest map dictates the size of the storage area allocated.
CICS Translator
Question 50: CICS Translator
The CICS translator converts CICS commands into the equivalent statements in the host programming language.
`TRANSID` in `EXEC CICS RETURN`
Question 51: `TRANSID` in `EXEC CICS RETURN`
Including `TRANSID` in `EXEC CICS RETURN` specifies the next transaction to be invoked when the user presses an attention key.
Accessing VSAM Files
Question 52: Accessing VSAM Files Using Alternate Index
You access a VSAM (Virtual Storage Access Method) file using an alternate index by defining the appropriate access path in the File Control Table and using the File Control commands.
BMS Field Length of 0
Question 53: BMS Field Length of 0
A BMS field length of 0 means that no data was entered into the field.
`EXEC CICS HANDLE CONDITION` (Continued)
Question 54: `EXEC CICS HANDLE CONDITION` Command (Continued)
This command allows you to handle various CICS conditions (errors). It directs program flow to a specific handler routine if a condition occurs during execution.
AICA ABEND
Question 55: AICA ABEND
An AICA ABEND (abnormal end) in CICS usually indicates a runaway task (a task that has consumed excessive CPU time).
Uppercase Conversion
Question 56: Preventing Uppercase Conversion
Use the `ASIS` option with the `RECEIVE` command to prevent uppercase conversion of input data.
`INTO` vs. `SET` (Continued)
Question 57: `INTO` vs. `SET` (Continued)
Differences:
Option | Function |
---|---|
INTO |
Copies data from the map area to a program variable. |
SET |
Returns a pointer to the map data area. |
ESDS File Access
Question 58: Accessing ESDS Files
Yes, you can access ESDS (Entry Sequenced Data Set) files from within CICS.
`BUFFER` Option
Question 59: `BUFFER` Option in `RECEIVE`
The `BUFFER` option in the `RECEIVE` command retrieves the entire contents of the terminal's input buffer.
`ASKTIME` vs. `EIBTIME`
Question 60: `ASKTIME` vs. `EIBTIME`
Differences:
ASKTIME
: Gets the current time.EIBTIME
: Gets the time the task started.
DFHMDF Macro
Question 61: DFHMDF Macro
The DFHMDF macro in BMS (Basic Mapping Support) defines individual fields on a CICS map.
MDT (Modified Data Tag), `FRSET`, and `FSET`
Question 62: MDT, `FRSET`, and `FSET`
The MDT (Modified Data Tag) indicates changes made to map fields. `FRSET` resets the MDT; `FSET` sets the MDT.
CICS Program Types
Question 63: CICS Program Types
CICS program types:
- Conversational
- Non-conversational
- Pseudo-conversational
Conversational Programs
Question 64: Conversational Programs
Conversational programs require user interaction; they alternate between sending data to the terminal and receiving input.
Non-Conversational Programs
Question 65: Non-Conversational Programs
Non-conversational programs run without user interaction; they typically generate reports or perform batch processing.
Pseudo-Conversational Programs
Question 66: Pseudo-Conversational Programs
Pseudo-conversational programs are event-driven; they respond to user actions but do not maintain continuous interaction.
TSQ vs. TDQ
Question 67: TSQ vs. TDQ
Differences:
Queue Type | Data Modification | Access | Batch Processing |
---|---|---|---|
TSQ (Temporary Storage Queue) | Allowed | Random | Not supported |
TDQ (Transient Data Queue) | Not allowed | Sequential | Supported |
ASRA ABEND
Question 68: Resolving ASRA ABEND
An ASRA ABEND (abnormal end) often indicates a runaway task. Troubleshooting involves examining task execution details using CICS monitoring tools.
DSECT Parameter in BMS
Question 69: DSECT Parameter in BMS
The DSECT (data section) parameter in BMS maps data areas to screen fields.
COMMAREA Size
Question 70: Default COMMAREA Size
The default size of COMMAREA (communication area) in CICS is 65K bytes.
CICS Error Handling
Question 71: Error Handling in CICS
Error handling in CICS involves checking return codes (`EIBRCODE`) and using `HANDLE CONDITION` to handle specific conditions.
CICS Error Codes
Question 72: AEIY Error Code
The AEIY abend code in CICS indicates a length error. This occurs when you attempt to move data to a field that is smaller than the source data. The receiving field is not large enough to accommodate the data being moved.