Wednesday, December 27, 2023

CICS Relinquish Control

 Where there is no task to execute, CICS will issue an OS wait to let lower priority jobs to tun. The ICV setting control the max time CICS will wait. An ICV ECB will created in the list of I/O ECB that CiCS waits on. 

CICS CSA

 In MVS, Common System Area is located at the top of the region. It is pointed to by R13. The first part of CSA is the register save area which is common for OS to point to via R13. CSA contains anchor pointer for many control blocks. CICS tables have been moved out to the OFL area. 

CWA followed CSA is not in used by CiCS functions. It is a global memory area that can see by all user transaction. There is no pointer in CSA to point to CWA. This CWA is located by a fixed offset from CSA start address. 

Optional Feature List follows CWA and is an extension to CSA. Because CWA is not pointed by CSA. Thus CWA cannot be relocated to another address and be located easily to give more space to extend CSA. OFL is added after CWA as an extension of CSA

80286 Protected Mode

 80286 has 5 system registers used to support protected mode.  When 80286 starts up, it is in real mode.  Real mode uses 24bit real address.  When in real mode, 80286 acts like 8086 but with higher throughput.  To enter protected mode, system program goes through 5 steps:

(1) Set up Global Descriptor in the real memory and load its address to GDTR. GDTR map the system pages that are shared by all processes

(2) Load the interrupt service routines in real memory and load its address to IDTR

(3) Set the PE bit in MSW (machine status word) to activate protected mode.  There is no way to go from protected mode back to real mode except by a hardware reset to 80286

80286 now acts in protected mode.  In other words, it will start translating virtual address and automatically switch tasks.   To complete the sequence, the system needs to load the task register and LDTR.


CICS Runaway Task

 A timer interrupt is set to detect task running in a loop and does not relinquish control based on the ICVR value. When the timer interrupt spring, it check the current running exceeded the time setting. If it does, the PSW will be set to x0000 to force a program check. DFHSRP intercept the check and change the abend code to ACIA. 

Friday, December 22, 2023

Program Compression

 CICS program subpool is separated from other subpool and is allocated from top down. Program compression means non-resident programs which are not in use is deleted during SOS.  The PPT is scanned to identified such program which may be reloaded in the war future. So program compression is a resource intensive operation. 

SCP maintained a minimum address for program subpool to keep the other data subpools from invading the program storage.  Program storage allocated below the threshold are freed as soon as the program use count is zero. 

CICS GETMAIN SOS

GETMAIN is issued by user program or by CICS routines on behalf of the user task.  Storage will be allocated from existing subpool page if available, or a new page if there is free page in DSA. When storage becomes a not available to satisfy a GETMAIN request, the task will be suspended with a DCI value set. The system enters a SOS condition and program compression is activated to try to release storage. 

CICS will then retry the GETMAIN from the suspended tasks and if successful, CICS will turn off the SOS condition. Otherwise, the SOS will continue.  This action also happened when a FREEMAIN happens during SOS. 

Task Storage

 TCA is created in the task subpool when a task was attached. The storage acquired by a task is chained from TCA SAA with the most recently acquired storage at the front of the chain. The next allocation is found in the SAA. The last area points to the STCA. 

TIOA is chained off from TCTTE instead of TCA because there is a chance that the task has gone when its terminal message still waiting to be sent. 

Free Area Queue Element

 FAQE is used to chain up free space within pages of same subpool. It is allocated after the storage area requested.  The element is linked by a double linked list  

Adjacent free areas will be consolidate upon RELEASE. If the FAQE unit s corrupted by user program, this type of storage violate can be detected earlier than using SAA. When it t happens, a dummy FAQE is created. 

PAM byte maps

 The byte map is used to indicate if the corresponding DSA page was in use or not. If in used, which subpool owns the page. 

There is a second byte map used to record some extended information for some of the subpools. 

CICS Subpools

 Control subpool is used to keep CICS control blocks such as DCA. The allocation is typically small and use a first fit algorithm. It uses 4 bytes SAA. 

Teleprocessing subpool contains TIOA. This subpool is usually large when there is a big network. The pool uses 8 bytes SAA and with end SAA to detect storage violation. 

Task subpools is used to hold control structures related to task such as TCA and VSWA. Program’s working. Storage and linkage section storage are also allocated out of this subpool. The storage requested by program at different time is not contiguous. The storage chain is addressed from TCA. As the storage is under control of user programs, CICS uses 8 bytes SAA and duplicate SAA at end of the area 

Shard subpool contains TS main storage and BMS. Four bytes SAA s used and no duplicate SAA

CICS SAA

 Storage accounting area has 2 formats - 4 bytes or 8 bytes. Some subpool has a duplicated saa ar the end of the storage area.  The saa at end of the storage is used to detect storage violation when the task write beyond the requested area. The saa contain a byte value that is stored see to initialize the storage. 

The 8 byte format contain extra field that chain up the next area belongs to the same task  subpool under the control of CICS (less susceptible to storage violation)uses 4 byte saa

CICS PAM

 Page allocation map describes the current DSA usage. Each PAM subpool entry is 16 bytes long describing each subpool.  It records the subpool ID and the number of pages assigned in the subpool. It also contain the FAQE pointers which chain up the free area ms within the pages which can be used for future requests. Program subpool does jot uses FAQE because the basic allocation for program is on page. Task storage also does not use FAQE. He pointers are kept in TCA instead. 

PAM also contains other fields like page size of DSA, the cushion size, the address of the first DSA page etc. 

the address shifting factor field contain a value depending on the page size (2K or 4K) and is used with the starting virtual address of DSA to conveniently deride the DsA page number for an arbitrary address or to locate the starting address of an arbitrary DSA page 

CICS DSA

 DSA constitute the memory area left over after all the program, buffer, tables, control blocks are allocated. DSA is divided into pages. Each pages are assigned to a different CICS subpools. Subspool determines how the storage is allocated to requests made. 

Examples of subpools are for control, telecom, task, RPL and program etc. program subpool pages are allocated from the top of DSA. Programs generally uses more space per request. The other subpools uses relatively smaller chunk of space 

CICS SCP

 Storage Control Program managed the DSA allocation. SCP issues GETMAIN and FREEMAIN macro to obtain and release memory for DSA. It monitor the usage so that it can issue warning (based on the storage cushion value) and perform recovery is storage is depleted.  Requests are queued when this happens. 

Monday, December 18, 2023

CICS TCA

The system TCA contains information used by the CICS control programs. It contains anchor points for task storage acquired by the transaction. It also contain pointer to COBOL working storage (TGT). 


The user TCA has s used to communicate information of request to CICS. It contains space for register save for KCP, SCP and for calling temp storage, file control and transient storage module