Professional Documents
Culture Documents
CICS Handbook
Study Material
Juhi Gaur
Reference Guide
Page 2
CICS Handbook
IGNORE CONDITION Command ...................................................................................................... 43 NOHANDLE Option ........................................................................................................................... 43 RESP Option ....................................................................................................................................... 44 PUSH and POP Commands................................................................................................................ 44 System Default action ......................................................................................................................... 45 HANDLE ABEND Command.............................................................................................................. 45 ABEND Command .............................................................................................................................. 46 CICS DATA ACCESS .............................................................................................................................47 FILE HANDLING ........................................................................................................................................ 47 File Access Methods ........................................................................................................................... 47 ESDS Entry Sequenced Data Set...................................................................................................... 47 KSDS - Key Sequenced Data Set......................................................................................................... 48 RRDS Relative Record Data Set ...................................................................................................... 48 Record Identification (RIDFLD)......................................................................................................... 48 VSAM File Access ............................................................................................................................... 49 READ Command................................................................................................................................. 49 WRITE Command ............................................................................................................................... 51 File Update ......................................................................................................................................... 51 Delete From File................................................................................................................................. 52 Browse Option .................................................................................................................................... 52 File Handling Exception Conditions................................................................................................ 54 File Handling Program Organization .............................................................................................. 55 CICS Database Access..................................................................................................................... 55 CICS - DB2 Program Preparation ..................................................................................................... 56 Files - Database Tables ...................................................................................................................... 57 CICS QUEUE HANDLING .......................................................................................................................58 TEMPORARY STORAGE QUEUE (TSQ) ...................................................................................................... 58 Temporary Storage - Output ............................................................................................................... 59 Temporary Storage Input ................................................................................................................. 59 Temporary Storage Deletion............................................................................................................ 60 TSQ Exceptional Conditions............................................................................................................ 60 TRANSIENT DATA QUEUE (TDQ) ............................................................................................................. 61 TDQ Intrapartition........................................................................................................................... 62 TDQ Intrapartition DCT Entry ..................................................................................................... 62 ATI Automatic Task Initiation.......................................................................................................... 63 TDQ Extrapartition.......................................................................................................................... 63 TDQ Extrapartition - DCT Entry..................................................................................................... 64 TRANSIENT STORAGE COMMANDS ........................................................................................................... 64 Transient Storage Output................................................................................................................. 64 Transient Storage Output................................................................................................................. 65 Transient Storage Deletion .............................................................................................................. 65 Exception Conditions:......................................................................................................................... 66 CICS IBM SUPPLIED TRANSACTIONS ............................................................................................66
Reference Guide
Page 3
CICS Handbook
Introduction
CICS is a powerful teleprocessing system designed to control information in an online environment. It provides the environment necessary for development and execution of on-line applications thereby freeing the application developer from the dependencies of the Operating System, Hardware, etc. The primary objective of CICS is to provide the control and service functions of the database/data communication (DB/DC) system as a package. Note: Batch System It has a system environment where jobs run one by one in a conventional way. Online System It has a system environment where many transactions run concurrently. CICS is available as following: CICS/ESA on IBM Mainframe running MVS CICS/400 on AS/400 running OS/400 CICS/6000 on RISC/6000 systems running AIX CICS/OS2 on PS/2 systems running OS/2 Features of CICS: Multi-tasking - Ability to control many tasks running concurrently in an address space. CICS provides for concurrent execution of multiple tasks, including tasks of the same type, like Order Entry. CICS has its own task management capabilities for execution of tasks within a single region partition and does not use the multitasking feature of the O/S. Multi-threading - Ability to use only one copy of the program when more than one task of the same type is active thereby minimizing main storage. Re-entrant - Ability to continue processing after an interruption. Since CICS performs task management and provides a separate copy of the working storage for each task currently active, CICS programs are also known as quasi re-entrant programs. Priority processing - Ability to execute tasks based on the priority set by the user for a transaction(program), terminal, terminal operator, etc. Services provided by CICS: Data Communication Services - Free application programs from handling terminal hardware - Interface to telecommunication methods such as VTAM, TCP/IP - Provide Communication capabilities between CICS regions and non-CICS regions across hardware. Data Management/Data Handling Services Reference Guide Page 4
CICS Handbook
Interface for handling files such as VSAM, BDAM etc. Interface for databases such as DB2, DL/I etc. Maintain Data Integrity through - Control of data Updates - Protection of data due to abnormal termination of application or system faults like CICS or O/S crash. Application Program Services - Interface with programming languages such as COBOL, C, PL/I - Program translation - Command Interpretation System Services - Interface with the Operating System for - program load and release - memory management - scheduling of tasks based on priority, etc Monitoring Services - Event Monitoring, Statistics collection for system tuning, etc. -
Transaction: A unit of work that is done as an atomic operation - that is, the operation succeeds or fails as a whole. In CICS, a transaction is identified by a 4 character ID, for e.g. TXN1 and is initiated, usually, by typing the transaction id in the top left hand corner of a screen. Task: An instance of the execution of a particular transaction type is a task. That is, one execution of a transaction, with a particular set of data, usually on behalf of a particular user at a particular terminal. Logical Unit of Work (LUW): A LUW is a collection of updating activity that is treated as a single unit. In other words, the period between the start of a particular set of changes and the point at which they are complete is called a logical unit of work (LUW). The LUW is a fundamental concept of CICS recovery. From the application designer's point of view, an LUW is a sequence of actions that needs to be complete before any of the individual actions can be regarded as complete as shown below. - - - - - - - - - - - - - - - LUW - - - - - - - - - - - - - - Task A |----------------|---------------------|--------------------------- SOT Update Delete EOT File - 1 2 records (SP)
Reference Guide
Page 5
CICS Handbook
Synchronization Point: Synchronization point is a point during processing activities of a program where all resource updates are complete and the resources are in good condition. The beginning of a task and normal completion of a task are considered to be syncpoints. Between the beginning and end of a task any number of syncpoints might be declared, they are called intermediate syncpoints. The end of a logical unit of work is indicated to CICS by a synchronization point (abbreviated to syncpoint). A syncpoint arises in the following ways: Implicitly at the end of a transaction, by an EXEC CICS RETURN command at the highest logical level. Explicitly by EXEC CICS SYNCPOINT commands issued (to commit the changes made to the resources such as files, database tables etc.) by the application programmer at appropriate points in the transaction. Every time an EXEC CICS SYNCPOINT command is issued, the existing LUW is completed and A new LUW is started. A LUW is the activity which a task does between two syncpoints. A task is called In-flight task until its LUW completes. Normally each LUW corresponds to a single task execution. But, this may not be true always. Consider a process that is updating a master file from a transaction file. If the program abends after processing 100 records, CICS will back out all the changes since the LUW is the end of the task. Hence to limit the scope of the LUW, we use SYNCPOINTs. If a failure occurs within a LUW, CICS backs out all changes to recoverable resources, to the beginning of the LUW. E.g.: 1) EXEC CICS SYNCPOINT END-EXEC. 2) EXEC CICS SYNCPOINT ROLLBACK END-EXEC. SYNCPOINT command is used to issue intermediate syncpoints. When a syncpoint command is issued, all the updates made by the task so far are committed and the resources maintained by the dynamic log are released. The SYNCPOINT command also releases the locks from the resources.
Reference Guide
Page 6
CICS Handbook
SYNCPOINT with ROLLBACK option is used to recover the recoverable resources up to the last syncpoint. CICS automatically issues a SYNCPOINT at the end of each task.
Conversation: In a typical online system, data is entered by the terminal user/operator. By pressing a terminal key, a transaction is triggered. Subsequent to the processing, the results are sent back to the terminal based on which the user responds by keying in additional data. This results in a sort of conversation between the terminal user and the transaction. Transactions, and thus programs, can be classified as: Conversational Program Pseudo conversational Program Pseudo conversational programs are more efficient than Conversational programs but involve a bit of programming.
TASK 1
TXNA working storage for task 1
TASK 2
TXNA working storage for task 2
TASK 1 started at terminal1 by user1 executes TXNA. TASK 2 started at terminal2 by user2 executes the same TXNA. These two tasks use the same load module associated with TXNA. However, the working storage for each task is different.
The difference between a task and transaction is shown above. Visualize a Library Information System. To add a new book, a record is to be added into the book-master database. Normally a transaction will be used for performing this operation. It is possible that several users may work at several terminals at the same time and add different book records to the master. All these users will use the same transaction, but CICS initiates a different task for each one of them. Each task will acquire a working storage section; however all the tasks will use the same load module. This feature is called multi-threading. Since several tasks can be running at the same time, CICS is a multi-tasking system.
Reference Guide
Page 7
CICS Handbook
Once a task is initiated, CICS will keep processing it till an I/O or external input is required. It then suspends that task and releases its resources. When the I/O is complete, CICS will then resume the task. This is called Quasi-reentrancy.