CICS

0
15

CICS – Overlook at

CICS is a DB/DC system which is used in onseries applications. CICS was developed end up beingcause batch operating system can execute only batch programs. CICS programs can end up being composed in COBOL, C, C++, Java, etc. These days, users want information wislim 2nds and in real time. To provide such fast service, we need a system which can process information onseries. CICS enables users to communicate with the back-end system to get the desireddish coloured information. Examples of onseries programs include onseries bancalifornia california king system, flight reservation, etc. Folloearng image shows the components of CICS and how they are inter-related −

CICS Overlook at

Functions of CICS

The main functions performed simply by CICS in an application are as follows −

  • CICS manages requests from concurrent users in an application.

  • Although, multiple users are worcalifornia california king on CICS system but it gives a feel to user thead wear he is the performle user only.

  • CICS gives the access to data files for reading or updating all of them in an application.

Features of CICS

The features of CICS are as follows −

  • CICS is an operating system in it’self, as it manages it’s own processor storage, has it’s own task manager which handles execution of multiple programs, and provides it’s own file management functions.

  • CICS provides onseries environment in batch operating system. Jobs submitted are executed immediately.

  • CICS is a generalized transworkion procesperform interface.

  • It is probable to have 2 or more CICS areas at the exwork same time, as CICS runs as a batch job in the operating system at the back-end.

CICS – Environment

CICS it’self works as an operating system. It’s job is to provide an environment for onseries execution of application programs. CICS runs in one area or partition or adgown space. CICS handles scheduling for programs running below it. CICS runs as a batch job and we can look at it in the spool simply by issuing the command PREFIX CICS*. There are five major services which are provided simply by CICS. All these services with each other perform a task.

CICS Environment

Folloearng are the services which we will end up being speak about thereing in detail step simply by step −

  • System Services
  • Data Communication Services
  • Data Handling Services
  • Application Programming Services
  • Monitoring Services
  • System Services

CICS maintains control functions to manage the allocation or de-allocation of resources wislim the system which are as follows −

  • Task Control − Task control provides task scheduling and multitascalifornia california king features. It conaspectrs care of the status of all CICS tasks. Task Control allocates the processor time among concurrent CICS tasks. This is calimmediateed multitascalifornia california king. CICS tries to prioritize the response time to the many kind of kind of imslotant task.

  • Program Control − Program Control manages loading and releaperform of application programs. As soon as a task end up beinggins, it end up beingcomes essential to bumociate the task with the appropriate application program. Although many kind of kind of tasks may need to use the exwork same application program, CICS loads only one duplicate of the code into memory. Each task threads it’s way through this particular code independently, so many kind of kind of users can all end up being running transworkions thead wear are concurrently uperform the exwork same physical duplicate of an application program.

  • Storage Control − Storage Control manages acquiring and releaperform of main storage. Storage control acquires, controls, and frees dynamic storage. Dynamic storage is used for inplace/awayplace areas, programs, etc.

  • Interval Control − Interval Control awayers timer services.

Data Communication Services

Data Communication Services interface with telecommunication access methods such as BTAM, VTAM, and TCAM for handling data communication requests from application programs.

  • CICS relreare locatedves application programs from the burden of dealing with terminal hardware issues through the use of Basic Mapping Supslot (BMS).

  • CICS provides Multi Region Operation (MRO) through which more than one CICS area in the exwork same system can communicate.

  • CICS provides Inter System Communication (ISC) through which a CICS area in a system can communicate with the CICS area on one more system.

Data Handling Services

Data Handling Services interface with data access methods such as BDAM, VSAM, etc.

  • CICS facilitates servicing of data handling requests from application programs. CICS provides application programmers a set of commands for dealing with data set and database access and related operations.

  • Data Handling Services interfaces with database access methods such as IMS/DB, DB2, etc. and facilitate servicing of database requests from application programs.

  • CICS facilitates management of data integrity simply by control of simultaneous record updates, protection of data as task ABENDs and protection of data at system failures.

Application Programming Services

Application Programming Services interface with application programs. The application programming services of CICS provide features such as command level translation, CEDF (the debug facility) and CECI (the command interpreter facility). We will end up being speak about thereing more in detail in upcoming modules.

Monitoring Services

Monitoring Services monitor various workuallyts wislim CICS adgown space. It provides series of statistical information thead wear can end up being used for system tuning.

CICS – Basic Terms

We must have knowladvantage of the fundamental terms used in CICS to get a end up beingtter belowstanding of how it works. Application programs use CICS for communication with remote and local terminals and subsystems.

IBM 3270 Terminal

The 3270 Information Display System is a family of display and printer terminals. 3270 terminals were end up beinging used to connect to the mainframe via IBM controllers. Today, 3270 emulation delicateware is available which means thead wear workually normal PCs can end up being used as 3270 terminals. 3270 terminals are dumb terminals and do not do any kind of kind of procesperform all of themselves. All procesperform needs to end up being done simply by the application program. IBM terminals consist of the folloearng components −

CRT Monitor

The CRT monitor displays the awayplace or the inplace fields of the application program. A screenshot of a 3278 Model of CRT monitor is shown end up beinglow. It has the folloearng charworkeristics −

  • It is capable of displaying 1920 charworkers.

  • Each of these 1920 charworker posit down downions is withindividually adgownable.

  • A COBOL application program can send data to all the posit down downions on the screen.

  • The display charworkeristics like intensit down downy, protected, non-protected of the field can end up being set uperform BMS which we will end up being speak about thereing in detail in upcoming modules.

CICS CRT Monitor

Keypanel

IBM keypanel keys are divided into folloearng 2 categories −

  • Non-AID Keys − All other keys for alphaend up beingts, numeric, punctuation etc. are Non-Aid keys. When the user kinds text or numend up beingrs uperform non-aid keys, CICS will not workually know if the user is typing any kind of kind ofslimg or not.

  • AID Keys − AID keys are known as Attention Identifier Keys. CICS can detect only AID keys. After typing all the inplace, only when the user presses one of the AID keys, CICS conaspectrs control. AID Keys : ENTER, PF1 to PF24, PA1 to PA3, CLEAR. AID keys are further divided into 2 categories −

    • PF Keys − PF keys are known as function keys. PF keys enable transfer of data from terminal to CICS. PF Keys are ENTER and PF1 to PF24.

    • PA Keys − PA keys are known as Program Access keys. PA keys do not enable transfer of data end up beingtween terminal and CICS. PA Keys are PA1 to PA3 and CLEAR.

CICS Keypanel

Transworkion

A CICS program is withinvoked through a transworkion. A CICS transworkion is a collection of logically related programs in an application. The whole application could end up being logically divided into various transworkions.

  • Transworkion identifiers which are 1 to 4 charworkers long are used to identify the transworkions which the users want to do.

  • A programmer links one program to the transworkion identifier which is used to invoke all the application programs for thead wear particular transworkion.

Task

A Task is a device of work which is specific to a user.

  • Users invoke an application simply by uperform one of the transworkion identifiers. CICS looks up for the transworkion identifier to find away which program to invoke first to do the work requested. It makes a task to do the work, and transfers control to the mentioned program.

  • A transworkion can end up being comppermited through various tasks.

  • A task can receive data from and send data to the terminal thead wear started it. It can read and write files and can start other tasks furthermore.

Task vs. Transworkion

The difference end up beingtween a transworkion and a task is thead wear various users can invoke a transworkion but each user initiates his own task.

LUW

LUW stands for Logical Unit of Work. LUW states thead wear a piece of work ought to end up being done comppermitely or not done at all. A task can contain various Logical Unit of Works in CICS. We will speak about there more abaway it in upcoming modules.

Application

An application is a series of logically grouped programs to form various transworkions which is used to comppermite a specific task for the end-user.

a

CICS – Nucleus

The five CICS system components descriend up beingd earare locatedr are a convenient grouping of CICS system programs, each of which performs it’s own specialised functions. The core of CICS known as the CICS Nucleus which consists of IBM-suppare locatedd CICS Control Programs and Control Tables.

Control Programs

CICS nucleus is constructed simply by the control programs and corresponding control tables. It provides unique advantages. It makes the CICS system highly flexible and thus easy to maintain. Folloearng are the imslotant control programs of CICS −

TCP

TCP is known as Terminal Control Program.

  • TCP is used to receive messages from the terminal.

  • It maintains hardware communication requirements.

  • It requests CICS to initiate the tasks.

KCP

KCP is known as Task Control Program.

  • KCP is used to simultaneously control the execution of tasks and it’s related properlinks.

  • It handles all the issues related to multi-tascalifornia california king.

PCP

PCP is known as Program Control Program.

  • PCP is used to locate and load programs for execution.

  • It transfers the control end up beingtween programs and in the end, it returns the control back to the CICS.

FCP

FCP is known as File Control Program.

  • FCP is used to provide application programs with services like read, insert, update or depermite records in a file.

  • It maintains exclusive control over the records in order to maintain data integrity during record updates.

SCP

SCP is known as Storage Control Program. It is used to control allocation and deallocation of storage wislim a CICS area.

Control Tables

CICS consists of IBM-suppare locatedd CICS control programs and tables. These tables need to end up being updated accordingly with the application information for successful execution of CICS application programs. Folloearng are the imslotant Control Tables −

TCT

TCT is known as Terminal Control Table.

  • When we login to a CICS terminal, an encheck is made in the TCT table.

  • TCT contains the terminal ID's thead wear are connected to current CICS area.

  • Terminal Control Program along with terminal control table recognise the incoming data from the terminal.

PCT

PCT is known as Program Control Table.

  • It contains the Transworkion IDs (TRANSID) and the corresponding program names or program IDs.

  • TRANSID is unique in PCT table.

PPT

PPT is known as Procesperform Program Table. PPT contains Program name or Mapset name, Task Use Counter, Language, Size, Main storage adgown, Load library adgown, etc.

  • Program or Mapset name is unique in a PPT table.

  • CICS receives the transworkion and a corresponding program name is allocated to the transworkion from the PCT. It checks if the program is loaded or not. If it is loaded, then the task use counter is withincrreare locatedved simply by 1. If the program is not loaded, then the program is first loaded and the task use counter is set to 1. It gets the load library adgown from the PPT table.

FCT

FCT is known as File Control Table.

  • It contains File names, File kind, record dimension, etc.

  • All the files used in a CICS program must end up being declareddish coloured in FCT and they are open up uped and shutd simply by CICS it’self.

Transworkion

When a transworkion identifier TP02 is entereddish coloured on the CICS terminal, first it checks if presently there is a program bumociated with this particular Transworkion identifier in the PCT table. If it finds one, then it checks in the PPT table to find the location of the Program to execute it.

If the program is already available in the memory, it starts executing thead wear particular program; if not, it loads the program to the memory from the 2ndary storage and then starts executing it.

CICS Transworkion

Transworkion Life Cycle

The transworkion life cycle has the folloearng steps −

CICS Transworkion Life Cycle

Step 1

The terminal operator initiates the transworkion simply by typing a 1 to 4 charworker transworkion-id and presperform the ENTER key.

Step 2

The TCP periodically checks all the terminals for inplace. When a message is received, it does the folloearng −

  • Instructs the SCP to make a TIOA.

  • Places the message in the TIOA.

  • Pbumes the control to the KCP.

Step 3

The KCP conaspectrs control from the TCP and does the folloearng −

  • Validates the transworkion-id and security.

  • Instructs the SCP to make a task control area.

  • Assigns priority to the task based on Terminal priority (Set in TCT), Operator priority (Set in SNT), and Transworkion priority (Set in PCT).

  • Adds the task to the queue of waiting programs.

  • Dispatches waiting programs in the order of priority.

  • Pbumes the control to the PCP.

Step 4

The PCP conaspectrs control from the KCP and does the folloearng −

  • Locates the program and loads it, if essential.

  • Transfers the control to the Application program.

Step 5

The Application program conaspectrs control from the PCP and does the folloearng −

  • Requests the TCP to place the message into the program’s WORKING STORAGE area.

  • Requests the FCP to retrieve records from the files.

Step 6

The FCP conaspectrs control from the Application program and does the folloearng −

  • Requests a File work area from the SCP.

  • Informs the KCP thead wear this particular task can wait until the I/O is comppermite.

Step 7

The KCP does the folloearng −

  • Dispatches the next task in the queue.

  • Re-dispatches the old task when I/O is comppermite.

  • Transfers the control to the FCP.

Step 8

The FCP returns control to the Application program.

Step 9

The Application program does the folloearng −

  • Processes the file data.

  • Requests TCP to send an I/O message.

  • Returns control to the PCP.

Step 10

The PCP returns the control back to the KCP requesting it to end the task.

Step 11

The KCP instructs the SCP to free all the storage allocated to the task (other than TIOA).

Step 12

The TCP does the folloearng −

  • Sends the awayplace to the terminal.

  • Requests the SCP to relreare locatedve the TIOA.

CICS – Transworkions

CICS transworkions are used to perform multiple operations in the CICS area. We will end up being speak about thereing the imslotant CICS transworkions suppare locatedd simply by IBM in detail.

CESN

CESN is known as CICS Execute Sign On.

  • CESN is used to Sign on to the CICS area.

  • We need to provide the User-Id and Pbumword given simply by the CICS administrator to log on to CICS. The folloearng screenshot shows how the sign-on screen looks like −

CICS CESN

CEDA

CEDA is known as CICS Execute Definition and Administration. It is used simply by CICS System Administrators to degreat CICS table entries and other administration workivilinks.

CEMT

CEMT is known as CICS Execute Master Terminal. It is used to inquire and update the status of CICS environments and furthermore for other system operations.

  • Uperform CEMT command, we can manage transworkions, tasks, files, programs, etc.

  • To get all the probable options, kind CEMT and press ENTER. It will display all the options.

  • CEMT is fundamentalally used for loading a brand brand new program into the CICS or for loading a brand brand new duplicate of the program into the CICS after the program or chartset is modifyd.

Example

One can overwrite the status of the file displayed to modify it. Folloearng example shows how to shut a file −

CEMT 
  
** Press ENTER & Folloearng Screen is displayed **  

STATUS: ENTER ONE OF THE FOLLOWING 
Inquire 
Perform 
Set 
 
** Command to shut a file **
  
CEMT SET FILE (file-name) 
CEMT I FILE (file-name)

CECI

CECI is known as CICS Execute Command Interpreter. Many kind of kind of CICS commands can end up being executed uperform CECI.

  • CECI is used to check the syntax of the command. It executes the command, only if the syntax is correct.

  • Type the CECI option on the empty CICS screen after having logged in. It gives you the list of options available.

Example

Folloearng example shows how to send chartped awayplace data to terminal. We will end up being speak about thereing abaway MAPS in the upcoming modules.

CECI SEND MAP (chart-name) MAPSET (chartset-name) ERASE 

CEDF

CEDF is known as CICS Execute Debug Facility. It is used for debugging the program step simply by step, which helps in finding the errors.

Type CEDF and press enter in the CICS area. The terminal is within EDF mode message will end up being displayed. Now kind the transworkion id and press the enter key. After initiation, with each enter key, a series is executed. Before executing any kind of kind of CICS command, it shows the screen in which we can modify the values end up beingfore proceeding further.

CMAC

CMAC is known as CICS Messages for Aend up beingnd Codes. It is used to find the explanation and reasons for CICS Aend up beingnd Codes.

Example

Folloearng example shows how to check details for an Aend up beingnd code −

CMAC aend up beingnd-code

CESF

CESF is known as CICS Execute Sign Off. It is used to Sign Off from the CICS area.

Example

Folloearng example shows how to log away from the CICS area −

CESF LOGOFF

CEBR

CEBR is known as CICS Execute Temporary storage Browse. It is used to display contents of a temporary storage queue or TSQ.

CEBR is used while debugging to check if the items of the queue are end up beinging composed and retrieved properly. We will speak about there more abaway TSQ in the upcoming modules.

Example

Folloearng example shows how to invoke the CEBR command −

CEBR queue-id

CICS Concepts

Each command could end up being achieved simply by executing a series of CICS macros. We will speak about there a few fundamental features which will help us belowstand the concepts end up beingtter −

Multitascalifornia california king

This feature of operating system enables more than one task to end up being executed concurrently. The task may end up being sharing the exwork same program or uperform various programs. The CICS schedules the task in it’s own area.

Multi-threading

This feature of the operating system enables more than one task to end up being executed concurrently sharing the exwork same program. For multi-threading to end up being probable, an application program ought to end up being a re-entrant program below the operating system or a quasi-reentrant below the CICS.

Re-entrancy

A re-entrant program is one which does not modify it’self and can re-enter in it’self and continue procesperform after an interruption simply by the operating system.

Quasi-reentrancy

A quasi-reentrant program is a re-entrant program below CICS environment. CICS ensures re-entrancy simply by acquiring a unique storage area for each task. Between CICS commands, the CICS has the exclusive correct to use the CPU resources and it can execute other CICS commands of other tasks.

There are times when many kind of kind of users are concurrently uperform the exwork same program; this particular is exworkly exworkly whead wear we call multi-threading. For example, permit’s suppose 50 users are uperform a program A. Here the CICS will provide 50 worcalifornia california king storage for thead wear program but one Procedure Division. And this particular technique is known as quasi-reentrancy.

CICS – COBOL Basics

CICS programs are composed in COBOL language in Mainframes. We will end up being speak about thereing abaway writing a fundamental COBOL-CICS program, compiling it, and then executing it.

CICS Program

We will end up being writing a fundamental COBOL-CICS program which displays a few message on the CICS awayplace screen. This program is to demonstrate the steps involved in executing a COBOL-CICS program. Folloearng are the steps to code a fundamental program −

Step 1

Login to Mainframes and open up up a TSO Session.

Step 2

Create a brand brand new PDS in which we will end up being coding our program.

Step 3

Create a brand brand new memend up beingr inpart the PDS and code the folloearng program −

IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO.
DATA DIVISION.
FILE SECTION.
WORKING-STORAGE SECTION.
01 WS-MESSAGE PIC X(40).
01 WS-LENGTH  PIC S9(4) COMP.
PROCEDURE DIVISION.
A000-MAIN-PARA.
   MOVE 'Hello World' TO WS-MESSAGE
   MOVE '+12' TO WS-LENGTH
   EXEC CICS SEND TEXT 
      FROM (WS-MESSAGE)
      LENGHT(WS-LENGTH)  
   END-EXEC
   EXEC CICS RETURN
   END-EXEC.	 

Step 4

After coding the program, we need to compile it. We can compile the program uperform the folloearng JCL −

//SAMPLE JOB(TESTJCL,XXXXXX),CLASS = A,MSGCLASS = C  
//CICSCOB  EXEC CICSCOB,                                                
//COPYLIB = ABC.XYZ.COPYLIB,                            
//LOADLIB = ABC.XYZ.LOADLIB 
//LIB        JCLLIB ORDER = CICSXXX.CICS.XXXPROC                
//CPLSTP     EXEC DFHEITVL                                
//TRN.SYSIN  DD DSN = ABC.XYZ.PDS(HELLO),DISP = SHR     
//LKED.SYSIN DD *                                        
   NAME HELLO(R)                                          
//

Step 5

Open a CICS session.

Step 6

We will now install the program uperform the folloearng command −

CEMT SET PROG(HELLO) NEW.

Step 7

Execute the program uperform the bumociated transworkion-id. Transworkion-id is provided simply by the Administrator. It will show the folloearng awayplace −

CICS Outplace

Program Compilation

The folloearng flowchart shows the steps used in compiling a COBOL-CICS program −

CICS Compilation

Translator

The function of a translator is to check for syntax errors in CICS commands. It translates all of them into equivalent COBOL statements.

Compiler

The function of a compiler is to expand the COBOL duplicate books. It compiles the code after checcalifornia california king the source code for syntax errors.

Linkage Editor

The function of a Linkage Editor is to link various object modules to make a performle load module.

CICS – BMS

BMS is known as Basic Mapping Supslot. An application consists of formatted screens which work as a bridge end up beingtween the terminal and the CICS programs. For communication to occur end up beingtween the terminal and the CICS programs, we use CICS terminal inplace/awayplace services. We use BMS to make screen styles with proper posit down downions and attributes. Folloearng are the functions of BMS −

  • BMS works as an interface end up beingtween the terminal and the CICS programs.

  • The style and format of the screen is separate from the logic of application.

  • BMS makes the application hardware independent.

Formatted Screen

The screen shown end up beinglow is a Menu Screen and can end up being styleed uperform BMS. It’s key stages are as follows −

  • The screen could have a Title, date, and any kind of kind of other information thead wear is to end up being displayed.

  • The Option 1, 2, and 3 are the Unnamed fields which are the titles of the screen.

  • In the Selection field, we need to provide the inplace. This withinplace is then sent to the CICS program for further procesperform.

  • At the bottom part of the screen, Action keys are displayed.

  • All the fields and the screen it’self is degreatd with BMS macros. When the whole chart is degreatd, we can use JCL to bumemble it.

CICS Screen

BMS Basic Terms

Folloearng are the fundamental terms which we will end up being uperform in the upcoming modules −

Map

Map is a performle screen format which can end up being styleed uperform BMS macros. It can have names containing 1 to 7 chars.

Mapset

Mapset is a collection of charts which are linked with each other to form a load module. It ought to have a PPT encheck. It can have names from 1 to 7 chars.

BMS Macros

BMS chart is a program which is composed in Assembly language to manage screens. The 3 macros thead wear are used to degreat the screen are DFHMSD, DFHMDI, and DFHMDF.

DFHMSD

DFHMSD macro generates Mapset definition. It is macro identifier which shows thead wear we are starting a chartset. The chartset name is the load module name and an encheck in PPT table must end up being present. The folloearng table shows the list of parameters which can end up being used in DFHMSD −

Sr.No Parameter & Description
1

TYPE

TYPE is used to degreat the chart kind. If TYPE =
MAP – Physical chart is maked
DSECT – Symbolic chart is maked
&&SYSPARM – Physical & Symbolic, both are maked
FINAL – To indicate the end of a chartset coding.

2

MODE

MODE is used to indicate inplace/awayplace operations. IF MODE =
IN – For an inplace chart only
OUT – For an awayplace chart only
INOUT For both inplace & awayplace chart

3

LANG

LANG = ASM/COBOL/PL1
It figure out there’s the language of the DSECT structure, for duplicateing into the application program.

4

STORAGE

If STORAGE =
AUTO – To acquire a separate symbolic chart area for each chartset
BASE – To have the exwork same storage base for the symbolic charts of from more than one chartset

5

CTRL

CRTL is used to degreat the device control requests. If CTRL =
FREEKB – To unlock the keypanel
FRSET – To reset MDT to zero status
ALARM – To set an alsupply at screen display time
PRINT – To indicate the chartset to end up being sent to the printer.

6

TERM

TERM = kind ensures device independence,requireddish coloured if other than 3270 terminal is end up beinging used.

7

TIOAPFX

TIOAPFX = YES/NO
YES – To reserve the prefix space (12 simply bytes) for BMS commands to access TIOA properly. Requireddish coloured for the CICS command level.

Example

The folloearng example shows how to code a chartset definition −

MPST01  DFHMSD TYPE = &SYSPARM, X
   CTRL = (FREEKB,FRSET), X
   LANG = COBOL, X 
   STORAGE = AUTO, X
   TIOAPFX = YES, X
   MODE = INOUT, X
   TERM = 3270
   DFHMSD TYPE = FINAL 
END

DFHMDI

DFHMDI macro generates chart definitions. It shows thead wear we are starting a brand brand new chart. Mapname is followed simply by the DFHMDI macro. Mapname is used to send or receive charts. The folloearng table shows the parameters which we use inpart a DFHMDI macro −

Sr.No Parameter & Description
1

SIZE

SIZE = (Line,Column)
This parameter gives the dimension of the chart. BMS enables us to develop a screen uperform various charts, and this particular parameter end up beingcomes imslotant when we are uperform more than one charts in a performle chartset.

2

LINE

It indicates the starting series numend up beingr of the chart.

3

COLUMN

It indicates the starting column numend up beingr of the chart.

4

JUSTIFY

It is used to specify the entire chart or the chart fields to end up being left or correct simplyified.

5

CTRL

CRTL is used to degreat the device control requests. If CTRL =
FREEKB – To unlock the keypanel
FRSET – To reset MDT to zero status
ALARM – To set an alsupply at screen display time
PRINT – To indicate the chart to end up being sent to the printer

6

TIOAPFX

TIOAPFX = YES/NO

YES – To reserve the prefix space (12 simply bytes) for BMS commands to access TIOA properly. Requireddish coloured for the CICS command level.

Example

The folloearng example shows how to code a chart definition −

MAPSTD DFHMDI SIZE = (20,80), X
   LINE = 01, X
   COLUMN = 01, X
   CTRL = (FREEKB,FRSET)

DFHMDF

DFHMDF macro is used to degreat field names. The field name is mentioned against which DFHMDF macro is coded. This field name is used inpart the program. We do not write field name against constant field which we do not want to use inpart the program. The folloearng table shows the list of parameters which can end up being used inpart a DFHMDF macro −

Sr.No Parameter & Description
1

POS

This is the posit down downion on the screen where the field ought to appear. A field starts with it’s attribute simply byte, so if you code POS = (1,1), the attribute simply byte for thead wear field is on series 1 in column 1, and the workual data starts in column 2.

2

LENGTH

This is the dimension of the field, not counting the attribute simply byte.

3

INITIAL

This is the charworker data for an awayplace field. We use this particular to specify laend up beingls and titles for the screen and maintain all of them independent of the program. For the first field in the menu screen, for example, we will code: INITIAL = 'MENU'.

4

JUSTIFY

It is used to specify the entire chart or the chart fields to end up being left or correct simplyified.

5

ATTRB

ATTRB = (ASKIP/PROT/UNPROT, NUM, BRT/NORM/DRK, IC, FSET) It descriend up beings the attributes of the field.

ASKIP – Autoskip. Data cannot end up being entereddish coloured in this particular field. The cursor skips to the next field.

PROT – Protected field. Data cannot end up being entereddish coloured into this particular field. If data is entereddish coloured, it will cause the inplace-inhibit status.

UNPROT – Unprotected field. Data can end up being entereddish coloured and this particular is used for all inplace fields.

NUM – Numeric field. Only numend up beingrs (0 to 9) and special charworkers('.' and '-') are enableed.

BRT – Bcorrect display of a field (highlight).

NORM – Normal display.

DRK – Dark display.

IC – Insert cursor. The cursor will end up being posit down downioned in this particular field. In case, IC is specified more than once, the cursor is placed in the final field.

FSET – Field set. MDT is set on so thead wear the field data is to end up being sent from the terminal to the host complaceer regardless of whether the field is workually modified simply by the user.

6

PICIN

PICIN appare locateds to the data field which is used as inplace like PICIN = 9(8).

7

PICOUT

PICIN appare locateds to the data field which is used as awayplace like PICOUT = Z(8).

Example

The folloearng example shows how to code a field definition −

DFHMDF POS = (01,01), X
   LENGTH = 7, X
   INITIAL = ‘SCREEN1’, X
      ATTRB = (PROT,NORM)
      STDID DFHMDF POS = (01,70), X
      LENGTH = 08, X
      ATTRB = (PROT,NORM)

CICS – MAP

BMS receives the data entereddish coloured simply by the user and then formats it into a symbolic chart area. The application program has access only to the data present in the symbolic chart. The application program processes the data and the awayplace is sent to the symbolic chart. BMS will merge the awayplace of the symbolic data with the physical chart.

CICS MAPS

Physical Map

Physical Map is a load module in the load library which contains information abaway how the chart ought to end up being displayed.

  • It contains the details abaway the attributes of all the fields in the chart and their own own posit down downions.

  • It contains the display format of the chart for a given terminal.

  • It is coded uperform BMS macros. It is bumembimmediateed separately and link edited into the CICS library.

Symbolic Map

A Symbolic Map is a Copy book in the library. The Copy book is used simply by the CICS application program to send and receive data from the terminal.

  • It contains all the variable data which is copied into program's WORKINGSTORAGE section.

  • It has all the named fields. The application programmer uses these fields to read and write data into the chart.

Skipper and Stopper Field

For an unprotected named field, in a chart, if we have specified a dimension of 10, this particular means thead wear the name field can conaspectr values whose dimension cannot exceed 10. But when you display this particular chart uperform CICS and start entering values for this particular field on the screen, we can enter more than 10 Charworkers, i.e., till the end of the screen and we can enter workually in the next series. To prworkuallyt this particular, we use Skipper field or quitper field. A Skipper field would generally end up being an Unnamed field of dimension 1, specified after a named field.

CICS Skipper & Stopper Field

Skipper Field

If we place a skipper field after the named unprotected field, then while entering the value, once the specified dimension is reached, the cursor will automatically posit down downion to the next unprotected field. The folloearng example shows how to add a skipper field −

NUMBER  DFHMDF POS = (01,01), X
   LENGTH = 5, X
   ATTRB = (UNPROT,IC)
      DFHMDF POS = (01,07), X
      LENGTH = 1, X
      ATTRB = (ASKIP)

Stopper Field

If we place a quitper field after the named unprotected field, then while entering the value, once the specified dimension is reached, the cursor will quit it’s posit down downioning. The folloearng example shows how to add a quitper field −

NUMBER  DFHMDF POS = (01,01), X
   LENGTH = 5, X
	ATTRB = (UNPROT,IC)
	   DFHMDF POS = (01,07), X
      LENGTH = 1, X
      ATTRB = (PROT)

Attribute Byte

The attribute simply byte of any kind of kind of field stores information abaway the physical properlinks of the field. The folloearng diagram and the table exsimple the significance of each bit.

CICS Attribute Byte

Bit Posit down downion Description Bit Settings
0 & 1   Determined simply by contents of bit 2 to 7
2 & 3 Protection & Shift 00 – Unprotected Alphanumeric
01 – Unprotected Numeric
10 – Protected Stop
11 – Protected Skip
4 & 5 Intensit down downy 00 – Normal
01 – Normal
10 – Bcorrect
11 – No-display ( Dark )
6   Must end up being Zero Always
7 Modified Data Tag 0 – Field has not end up beingen modified
1 – Field has end up beingen modified

Modified Data Tag

Modified Data Tag (MDT) is the final bit in the attribute simply byte.

  • MDT is a flag which holds a performle bit. It specifies whether the value is to end up being transferreddish coloured to the system or not.

  • It’s default value is 1, when the field value is modifyd.

  • If MDT is 0, then data cannot end up being transferreddish coloured; and if MDT is 1, then data can end up being transferreddish coloured.

Send Map

The send chart command writes formatted awayplace to the terminal. It is used to send the chart to the terminal from the application program. The folloearng code segment shows how to send a chart to the terminal −

EXEC CICS SEND 
   MAP('chart-name')
   MAPSET('chartset-name')
   [FROM(data-area)]
   [LENGTH(data_value)]
   [DATAONLY]
   [MAPONLY]
   [CURSOR]
   [ERASE/ERASEAUP]
   [FREEKB] 
   [FRSET]
END-EXEC   

The folloearng table lists the parameters used in a send chart command along with their own own significance.

Sr.No Parameter & Description
1

Map-name

It is the name of the chart which we want to send. It is mandatory.

2

Mapset-name

It is the name of the chart set thead wear contains the chartname. The chartset name is needed unless it is the exwork same as the chart name.

3

FROM

It is used if we have figure out thered to use a various DSECT name, we must use the option FROM (dsect-name) along with SEND MAP command.

4

MAPONLY

It means thead wear no data from your own program is to end up being merged into the chart and only the information in the chart is transmitted.

5

DATAONLY

It is the logical opposit down downe of MAPONLY. We use it to modify the variable data in a display thead wear has already end up beingen maked. Only the data from your own program is sent to the screen. The constants in the chart are not sent.

6

ERASE

It causes the entire screen to end up being erased end up beingfore exworkly exworkly whead wear we are sending is shown.

7

ERASEUP

It causes only unprotected fields to end up being erased.

8

FRSET

Flag Reset turns away the modified data tag in the attribute simply byte for all the fields on the screen end up beingfore exworkly exworkly whead wear you are sending is placed presently there.

9

CURSOR

It can end up being used to posit down downion the cursor on the terminal screen. Cursor can end up being set simply by moving -1 to the L part of the field and then sending the chart.

10

ALARM

It causes the audible alsupply to end up being sounded.

11

FREEKB.

The keypanel is unlocked if we specify FREEKB in either the chart or the SEND command.

12

PRINT

It enables the awayplace of a SEND command to end up being printed on a printer.

13

FORMFEED

It causes the printer to restore the paper to the top of the next page end up beingfore the awayplace is printed.

Receive Map

When we want to receive inplace from a terminal, we use the RECEIVE MAP command. The MAP and MAPSET parameters have exworkly the exwork same meaning as for the SEND MAP command. The folloearng code segment shows how to receive a chart −

EXEC CICS RECEIVE 
   MAP('chart-name')
   MAPSET('chartset-name')
   [INTO(data-area)]
   [FROM(data-area)]
   [LENGTH(data_value)]
END-EXEC

Mapset Execution

The folloearng steps are essential to develop and execute a chartset −

  • Step 1 − Open a TSO session.

  • Step 2 − Create a brand brand new PDS.

  • Step 3 − Code a chartset in a brand brand new memend up beingr according to the requirement.

  • Step 4 − Assemble the chartset uperform the JCL provided simply by the CICS administrator.

  • Step 5 − Open a CICS Session.

  • Step 6 − Install the program uperform the command −

    CEMT SET PROG(chartset-name) NEW

  • Step 7 − Type the folloearng command to send the Map to the terminal −

    CECI SEND MAP(chart-name) MAPSET(chartset-name) ERASE FREEKB

CICS – Interface Block

Any application program would require an interface to interwork with the CICS. EIB (Execute Interface Block) works as an interface to enable application programs communicate with the CICS. EIB contains the information requireddish coloured during the execution of a program.

Restringented COBOL Verbs

While coding a CICS program, we cannot use the commands which return the control immediately to the MVS. If we code these COBOL verbs, it will not give any kind of kind of compilation error, but we may get unpreddish colouredictable results. Folloearng are the COBOL verbs which ought to not end up being used in a CICS program −

  • File I/O statements like Open, Read, Write, Rewrite, Close, Depermite, and Start. All file I/O in CICS is handimmediateed simply by the file control module and they have their own own own set of statements like READ, WRITE, REWRITE, and DELETE which we will end up being speak about thereing in the upcoming modules.

  • File Section and Environment Division is not requireddish coloured.

  • COBOL statements thead wear invoke operating system functions like Accept, Date/Time cannot end up being used.

  • Do not use DISPLAY, MERGE, STOP RUN, and GO BACK.

Execute Interface Block

Execute Interface Block (EIB) is a control block which is loaded automatically simply by the CICS for every program.

  • The EIB is unique to a task and it exists for the duration of the task. It contains a set of system related information corresponding to the task.

  • It contains information abaway transworkion identifier, time, date, etc., which is used simply by the CICS during the execution of an application program.

  • Every program thead wear executes as a part of the task has access to the exwork same EIB.

  • The data in EIB at runtime can end up being look ated simply by executing the program in CEDF mode.

EIB Fields

The folloearng table provides a list of fields which are present in EIB −

EIB Field PIC Clause Description
EIBAID X(1) Aid key Pressed
EIBCALEN S9(4) COMP It contains dimension of DFHCOMMAREA
EIBDATE S9(7) COMP-3 It contains Current System Date
EIBRCODE X(6) It contains Return code of the final transworkion
EIBTASKN S9(7) COMP-3 It contains Task numend up beingr
EIBTIME S9(7) COMP-3 It contains Current System Time
EIBTRMID X(4) Terminal Identifier
EIBTRNID X(4) Transworkion Identifier

CICS Programs Clbumification

CICS Programs are courseified in the folloearng 3 categories which we will speak about there one simply by one −

  • Non-Conversational Programs
  • Conversational Programs
  • Pseudo-Conversational Programs – We will speak about there in the next module

Non Conversational Programs

While executing non-conversational programs, no individual intervention is requireddish coloured. All the essential inplaces are provided when the program is started.

  • They are similar to batch programs thead wear run in the batch mode. So in CICS, they are rarely developed.

  • We can say they are used simply for displaying a sequence of screens at regular intervals of time.

Example

The folloearng example shows a non-conversational program which will simply display "HELLO WORLD" on the CICS terminal as awayplace −

IDENTIFICATION DIVISION.                                
PROGRAM-ID. HELLO.                                      
DATA DIVISION.                                          
WORKING-STORAGE SECTION.                                
01 WS-MESSAGE          PIC X(30).                       
PROCEDURE DIVISION.                                     
********************************************************
* SENDING DATA TO SCREEN                               * 
********************************************************
   MOVE 'HELLO WORLD' TO WS-MESSAGE                
   EXEC CICS SEND TEXT                             
      FROM (WS-MESSAGE)                          
   END-EXEC                                        
********************************************************
* TASK TERMINATES WITHOUT ANY INTERACTION FROM THE USER* 
********************************************************
   EXEC CICS RETURN                                
END-EXEC.

Conversational Program

Sending a message to the terminal and receiving a response from the user is calimmediateed a conversation. An onseries application achieves a conversation end up beingtween the user and the application program simply by a pair of SEND and RECEIVE command. The key stages of a Conversational program are as follows −

  • The system sends a message to the screen and wait’s for the user’s response.

  • The time conaspectrn simply by user to respond is known as Think Time. This time is conpartrably high, which is a major drawback of Conversational programs.

  • The user provides the essential inplace and presses an AID key.

  • The application processes the user’s inplace and sends the awayplace.

  • The program is loaded into the main storage at the end up beingginning and is retained till the task ends.

CICS Conversion Program

Example

The folloearng example shows a conversion program which conaspectrs inplace from the user and then simply displays the exwork same inplace on the CICS terminal as awayplace −

IDENTIFICATION DIVISION.                               
PROGRAM-ID. HELLO.                                     
DATA DIVISION.                                         
WORKING-STORAGE SECTION.                               
01 WS-MESSAGE          PIC X(30) VALUE SPACES.         
PROCEDURE DIVISION.                                    
   MOVE 'ENTER MESSAGE' TO WS-MESSAGE           
********************************************************
* SENDING DATA FROM PROGRAM TO SCREEN                  * 
********************************************************
   EXEC CICS SEND TEXT                            
      FROM (WS-MESSAGE)                         
   END-EXEC                                       
********************************************************
* GETTING INPUT FROM USER                              * 
********************************************************
   EXEC CICS RECEIVE                              
      INTO(WS-MESSAGE)                          
   END-EXEC                                       
   EXEC CICS SEND TEXT                            
      FROM (WS-MESSAGE)                         
   END-EXEC                                       
********************************************************
* COMMAND TO TERMINATE THE TRANSACTION                 * 
********************************************************
   EXEC CICS RETURN                               
END-EXEC.                                       

CICS – Pseudo Programming

As of now, we have covereddish coloured non-conversion and conversion programs. Conversion programs have a major drawback as their own own beare locatedve time is conpartrably high. To overcome this particular issue, pseudo-conversion programming came into the picture. We will now speak about there more abaway pseudo-conversion programs.

Pseudo-Conversion Program

Folloearng is the sequence of workuallyts which conaspectr place in a pseudo-conversion program −

  • Step 1 − The system sends a message to the screen and terminates the transworkion, specifying the transworkion to end up being started when the user inplace is received.

  • Step 2 − The system allocates the resources used simply by this particular transworkion to other transworkions running in the system. So we can utilize the resources in a pseudo-conversion program till the user gives the inplace.

  • Step 3 − The system polls the terminal inplace at regular intervals of time. When the inplace is received, it is processed and the awayplace is displayed.

  • Step 4 − The application program is loaded into the main storage when needed and relreare locatedved when not in use.

CICS Pseudo Conversion Program

Pseudo Conversion Techniques

The imslotant stage to note in pseudo-conversation is pasperform of data end up beingtween every task. We will speak about there abaway the techniques for pasperform data.

COMMAREA

COMMAREA is known as communication area. COMMAREA is used to pbum data end up beingtween tasks. The folloearng example shows how to pbum COMMAREA where WSCOMMAREA and WS-COMMAREA-LENGTH are declareddish coloured in Worcalifornia california king Storage Section −

EXEC CICS RETURN
   TRANSID ('transworkion-id')
   COMMAREA (WS-COMMAREA)
   LENGTH  (WS-COMMAREA-LENGTH)
END-EXEC.

DFHCOMMAREA

DFHCOMMAREA is a special memory area which is provided simply by CICS to every task.

  • It is used to pbum data from one program to one more program. The programs can exist in the exwork same transworkion or in various transworkion furthermore.

  • It is declareddish coloured in the Linkage Section of the program at 01 level.

  • It ought to have the exwork same picture clause as WS-COMMAREA.

  • Data can end up being moved back from DFHCOMMAREA to WS-COMMAREA uperform a MOVE statement.

MOVE DFHCOMMAREA TO WS-COMMAREA.

Example

After sending the chart, the task ends and wait’s for the user response. At this particular stage, the data needs to end up being saved, end up beingcause though the task has ended, the transworkion has not. When this particular transworkion is to end up being resumed, it would require the prior status of the task. User enters the inplace. This now has to end up being received simply by the RECEIVE MAP command and then validated. The folloearng example shows how to declare COMMAREA and DFHCOMMAREA −

WORKING-STORAGE SECTION.
01 WS-COMMAREA.
   05 WS-DATA PIC X(10).
   
LINKAGE SECTION.
01 DFHCOMMAREA.
   05 LK-DATA PIC X(10).

Pseudo Code

Given end up beinglow is the logic of pseudo code which we use in pseudo programming −

MOVE DFHCOMMAREA TO WS-COMMAREA
IF EIBCALEN = 0
   STEP1: SEND MAP
   STEP2: MOVE <internal-transworkion-id1> to WS-COMMAREA
   STEP3: ISSUE CONDITIONAL RETURN
ELSE
   IF WS-COMMAREA = <internal-transworkion-id1> 
      STEP4: RECEIVE MAP
      STEP5: PROCESS DATA
      STEP6: SEND OUTPUT MAP
      STEP7: MOVE <internal-transworkion-ID2> to WS-COMMAREA
      STEP8: ISSUE CONDITIONAL RETURN 
   END-IF
END-IF      
STEP9: REPEAT STEP3 TO STEP7 UNTIL EXIT

Example

The folloearng example shows a pseudo-conversion program −

******************************************************************
* PROGRAM TO DEMONSTRATE PSEUDO-CONVERSATION                     *
******************************************************************
IDENTIFICATION DIVISION.                                         
PROGRAM-ID. HELLO.                                               
DATA DIVISION.                                                   
WORKING-STORAGE SECTION.                                         
01 WS-MESSAGE          PIC X(30).                                
01 WS-COMMAREA         PIC X(10) VALUE SPACES.                    
LINKAGE SECTION.                                                 
01 DFHCOMMAREA         PIC X(10).                                 
PROCEDURE DIVISION.
   MOVE DFHCOMMAREA TO WS-COMMAREA
   IF  WS-COMMAREA  =  SPACES                                   
******************************************************************
* TRANSACTION GETTING EXECUTED FOR THE FIRST TIME                *
******************************************************************
   MOVE 'HELLO' TO WS-MESSAGE                               
   EXEC CICS SEND TEXT                                      
      FROM (WS-MESSAGE)                                   
   END-EXEC                                                 
   MOVE 'FIRST' TO WS-COMMAREA                              
******************************************************************
* TASK ENDS AS A RESULT OF RETURN. IF AID KEY PRESSED, NEXT      *
* TRANSACTION SHOULD BE TP002. DATA PASSED FROM WS-COMMAREA TO   *
* DFHCOMMAREA                                                    *
******************************************************************
   EXEC CICS RETURN                                         
      TRANSID('TP002')                                      
      COMMAREA(WS-COMMAREA)                                
   END-EXEC                                                 
******************************************************************
* IF  COMMAREA IS NOT EMPTY , THEN TP002 HAS BEEN EXECUTED ONCE  *
* ALREADY, USER INTERACTION IS FACILITATED BY RECEIVE            *
******************************************************************
   ELSE                                                         
      EXEC CICS RECEIVE                                        
         INTO(WS-MESSAGE)                                    
   END-EXEC
      EXEC CICS SEND TEXT                                      
      FROM (WS-MESSAGE)                                   
   END-EXEC                                                 
******************************************************************
* TASK ENDS AS A RESULT OF RETURN, NO NEXT TRANSACTION SPECIFIED *
* TO BE EXECUTED                                                 *
******************************************************************
   EXEC CICS RETURN                                         
   END-EXEC                                                 
END-IF.       

Advantages of Pseudo Conversion

Folloearng are the advantages of pseudo conversion −

  • The resources are end up beingst utilized. Resources are relreare locatedved as soon as the program is suinvested temporarily.

  • It looks as if it is within conversational mode.

  • It has end up beingtter response time.

Return Statements

Folloearng are the 2 kinds of return statements which are used in CICS −

Return-1

When the folloearng unconditional return statement is issued, the task and the transworkion (program) is terminated.

EXEC CICS RETURN 
END-EXEC.

Return-2

When the folloearng conditional return, i.e., return with TRANSID statement is issued, the control returns to the CICS with the next transid to end up being executed. The next transworkion starts when the user presses an AID key.

EXEC CICS RETURN
   TRANSID ('trans-id')
   [COMMAREA(WS-COMMAREA)]
END-EXEC.

CICS – Aid Keys

As we have speak about thereed in earare locatedr modules, AID keys are known as Attention Identifier Keys. CICS can detect only AID keys. After typing all the inplace, only when the user presses one of the AID keys, the CICS conaspectrs control. AID Keys include ENTER, PF1 to PF24, PA1 to PA3, and CLEAR.

Validating AID keys

The key pressed simply by the user is checked simply by uperform EIBAID.

  • EIBAID is one simply byte long and holds the workual attention identifier value used in the 3270 inplace stream.

  • CICS provides us with a pre-coded set of variables which can end up being used in the application program simply by writing the folloearng statement −

    COPY DFHAID

DFHAID

DFHAID is a duplicatebook which is used in application programs to include CICS pre-coded set of variables. The folloearng content is present in the DFHAID duplicatebook −

01    DFHAID.                             
   02  DFHNULL   PIC  X  VALUE IS ' '.     
   02  DFHENTER  PIC  X  VALUE IS ''''.    
   02  DFHCLEAR  PIC  X  VALUE IS '_'.     
   02  DFHCLRP   PIC  X  VALUE IS '¦'.     
   02  DFHPEN    PIC  X  VALUE IS '='.     
   02  DFHOPID   PIC  X  VALUE IS 'W'.     
   02  DFHMSRE   PIC  X  VALUE IS 'X'.     
   02  DFHSTRF   PIC  X  VALUE IS 'h'.     
   02  DFHTRIG   PIC  X  VALUE IS '"'.     
   02  DFHPA1    PIC  X  VALUE IS '%'.     
   02  DFHPA2    PIC  X  VALUE IS '>'.     
   02  DFHPA3    PIC  X  VALUE IS ','.     
   02  DFHPF1    PIC  X  VALUE IS '1'.     
   02  DFHPF2    PIC  X  VALUE IS '2'.     
   02  DFHPF3    PIC  X  VALUE IS '3'.     
   02  DFHPF4    PIC  X  VALUE IS '4'.     
   02  DFHPF5    PIC  X  VALUE IS '5'.     
   02  DFHPF6    PIC  X  VALUE IS '6'.     
   02  DFHPF7    PIC  X  VALUE IS '7'.     
   02  DFHPF8    PIC  X  VALUE IS '8'.     
   02  DFHPF9    PIC  X  VALUE IS '9'.     
   02  DFHPF10   PIC  X  VALUE IS ':'.     
   02  DFHPF11   PIC  X  VALUE IS '#'.     
   02  DFHPF12   PIC  X  VALUE IS '@'.     
   02  DFHPF13   PIC  X  VALUE IS 'A'.     
   02  DFHPF14   PIC  X  VALUE IS 'B'.     
   02  DFHPF15   PIC  X  VALUE IS 'C'.   
   02  DFHPF16   PIC  X  VALUE IS 'D'.   
   02  DFHPF17   PIC  X  VALUE IS 'E'.   
   02  DFHPF18   PIC  X  VALUE IS 'F'.   
   02  DFHPF19   PIC  X  VALUE IS 'G'.   
   02  DFHPF20   PIC  X  VALUE IS 'H'.   
   02  DFHPF21   PIC  X  VALUE IS 'I'.   
   02  DFHPF22   PIC  X  VALUE IS '¢'.   
   02  DFHPF23   PIC  X  VALUE IS '.'.   
   02  DFHPF24   PIC  X  VALUE IS '<'.   

Example

The folloearng example shows how to use DFHAID duplicatebook in an application program −

IDENTIFICATION DIVISION.                                         
PROGRAM-ID. HELLO.                                               
DATA DIVISION.   
WORKING-STORAGE SECTION.
COPY DFHAID.
PROCEDURE DIVISION.
A000-AIDKEY-PARA.
   EVALUATE EIBAID
      WHEN DFHAID
         PERFORM A000-PROCES-PARA
      WHEN DFHPF1
         PERFORM A001-HELP-PARA
      WHEN DFHPF3
         PERFORM A001-EXIT-PARA
    END-EVALUATE.

Cursor Posit down downioning

There are 2 ways to override the posit down downion specified in the chart definition.

  • One way is to specify the screen posit down downion relative to series and column numend up beingr in the CURSOR option on the send chart command.

  • Other way is to move -1 to the symbolic chart variable suffixed with L. Then, send the chart with a CURSOR option in the SEND MAP.

Example

The folloearng example shows how to override the cursor posit down downion for the NAME field −

MOVE -1 TO NAMEL
   EXEC CICS SEND 
      MAP ('chart-name')
      MAPSET ('name-field')
      ERASE
      FREEKB
      CURSOR
   END-EXEC.

Dynamically Modifying Attributes

While sending a chart, if we want to have various attributes for a field other than thead wear is specified in the chart, then we can override thead wear simply by setting the field in the program. Folloearng is the explanation to override attributes of a field −

  • To override the attributes of a field, we must include DFHATTR in the application program. It is provided simply by CICS.

  • The attribute requireddish coloured can end up being chosen from the list and moved to the symbolic field variable suffixed with 'A'.

DFHATTR holds the folloearng content −

01  CICS-ATTRIBUTES.
   05  ATTR-UXN            PIC X(01) VALUE SPACE.
   05  ATTR-UXMN           PIC X(01) VALUE 'A'.
   05  ATTR-UXNL           PIC X(01) VALUE 'D'.
   05  ATTR-UXMNL          PIC X(01) VALUE 'E'.
   05  ATTR-UXBL           PIC X(01) VALUE 'H'.
   05  ATTR-UXMBL          PIC X(01) VALUE 'I'.
   05  ATTR-UXD            PIC X(01) VALUE '<'.
   05  ATTR-UXMD           PIC X(01) VALUE '('.
   05  ATTR-U9N            PIC X(01) VALUE '&'.
   05  ATTR-U9MN           PIC X(01) VALUE 'J'.
   05  ATTR-U9NL           PIC X(01) VALUE 'M'.
   05  ATTR-U9MNL          PIC X(01) VALUE 'N'.
   05  ATTR-U9BL           PIC X(01) VALUE 'Q'.
   05  ATTR-U9MBL          PIC X(01) VALUE 'R'.
   05  ATTR-U9D            PIC X(01) VALUE '*'.
   05  ATTR-U9MD           PIC X(01) VALUE ')'.
   05  ATTR-PXN            PIC X(01) VALUE '-'.
   05  ATTR-PXMN           PIC X(01) VALUE '/'.
   05  ATTR-PXNL           PIC X(01) VALUE 'U'.
   05  ATTR-PXMNL          PIC X(01) VALUE 'V'.
   05  ATTR-PXBL           PIC X(01) VALUE 'Y'.
   05  ATTR-PXMBL          PIC X(01) VALUE 'Z'.
   05  ATTR-PXD            PIC X(01) VALUE '%'.
   05  ATTR-PSN            PIC X(01) VALUE '0'.
   05  ATTR-PSMN           PIC X(01) VALUE '1'.
   05  ATTR-PSNL           PIC X(01) VALUE '4'.
   05  ATTR-PSMNL          PIC X(01) VALUE '5'.
   05  ATTR-PSBL           PIC X(01) VALUE '8'.
   05  ATTR-PSMBL          PIC X(01) VALUE '9'.
   05  ATTR-PSD            PIC X(01) VALUE '@'.
   05  ATTR-PSMD           PIC X(01) VALUE "'".

CICS – File Handling

CICS enables us to access file data in many kind of kind of ways. Most file accesses are random in onseries system as the transworkions to end up being processed are not batched and sorted into any kind of kind of kind of order. Therefore CICS supslots the usual immediate access methods − VSAM and DAM (Direct Access Method). It furthermore enables us to access data uperform database managers.

Random Access

Folloearng are the commands which are used for random procesperform −

Sr.No Commands & Description
1 READ

READ command reads data from a file uperform primary key.

2 WRITE

Write command is used to add brand brand new records to a file.

3 REWRITE

REWRITE command is used to modify a record thead wear is already present in a file.

4 DELETE

DELETE command is used to depermite a record thead wear is present in a file.

Sequential Access

Folloearng are the commands which are used for sequential procesperform −

Sr.No Commands & Description
1 STARTBR

STARTBR is known as start browse.

2 READNEXT / READPREV

When we issue a STARTBR command, it does not make the records available.

3 RESETBR

The RESETBR command enables us to reset our starting stage in the middle of a browse.

4 ENDBR

When we have comppermiteed reading a file sequentially, we terminate the browse uperform the ENDBR command.

CICS – Error Handling

There are many kind of kind of kinds of aend up beingnds and errors which one can face while uperform a CICS application. Errors can arise because of to both hardware of delicateware issues. We will end up being speak about thereing abaway errors and error handling in this particular module.

CICS Errors

Folloearng are the CICS errors which can arise during the execution of CICS applications −

  • Some expected CICS errors arise when the conditions are not normal in the CICS system. For example, if we are reading a particular record and the record is not found, then we get the "Not Found" error. Mapfail is a similar error. Errors in this particular category are handimmediateed simply by explicit logic in the program.

  • Logical errors arise because of to a few reasons like division simply by zero, unlawful charworker in numeric field, or transworkion id error.

  • Errors thead wear are related to hardware or other system conditions are end up beingyond the control of an application program. For example, getting inplace/awayplace error while accesperform a file.

Error Handling Commands

CICS provides various mechanisms to identify the errors and to handle all of them in our programs. Folloearng are the commands which are used to handle the expected CICS errors −

Sr.No Handling Commands & Description
1 Handle condition

Handle condition is used to transfer the control of the program to a section or a procedure laend up beingl.

2 Handle Aend up beingnd

If a program aend up beingnds because of to a few reasons like inplace-awayplace error, then it can end up being handimmediateed uperform Handle Aend up beingnd CICS command.

3 Aend up beingnd

Aend up beingnd command is used to terminate the task intentionally.

4 Ignore Condition

Ignore condition is used when we want no workion to end up being conaspectrn if a particular aend up beingnd or error happens which is mentioned inpart the Ignore Condition.

5 Nohandle

Nohandle can end up being specified for any kind of kind of CICS command.

CICS – Control Operations

CICS Program Control Program (PCP) manages the flow of application programs. All the application programs must have an encheck in the Procesperform Program Table. Folloearng are the commands which are used for program control services −

  • XCTL
  • Link
  • Load
  • Relreare locatedve
  • Return

Program Logical Levels

The application programs which execute below CICS have various logical levels. The first program which receives the control immediately is at highest logical level, i.e., Level 1. The Linked program is at the next logical level from the lincalifornia california king program. The XCTL programs run at the exwork same level. It will end up being clear when we will go through Link and XCTL, later in this particular module. The folloearng image shows the logical levels −

CICS Control Operations

XCTL

The fundamental explanation of XCTL is as follows −

  • XCTL command is used to pbum the control from one program to one more at the exwork same level.

  • It does not expect the control back.

  • It is similar to GO TO statement.

  • An XCTL program can end up being a pseudo-conversational.

Example

The folloearng example shows how to use XCTL command to pbum the control to one more program −

IDENTIFICATION DIVISION.                                         
PROGRAM-ID. PROG1.  
WORKING-STORAGE SECTION.
01 WS-COMMAREA    PIC X(100).                                             
PROCEDURE DIVISION.

EXEC CICS XCTL
   PROGRAM ('PROG2')
   COMMAREA (WS-COMMAREA)
   LENGTH (100)
END-EXEC.

This command transfers the control to end up being pbumed to program 'PROG2' with 100 simply bytes of data. COMMAREA is an optional parameter and is the name of the area containing the data to end up being pbumed or the area to which results are to end up being returned.

Link

Link command is used to transfer the control to one more program at lower level. It expects the control back. A Linked program cannot end up being pseudo-conversational.

Example

The folloearng example shows how to use Link command to pbum the control to one more program −

IDENTIFICATION DIVISION.                                         
PROGRAM-ID. PROG1.  
WORKING-STORAGE SECTION.
01 WS-COMMAREA    PIC X(100).                                             
PROCEDURE DIVISION.

EXEC CICS LINK
   PROGRAM ('PROG2')
   COMMAREA (WS-COMMAREA)
   LENGTH (100)
END-EXEC.

Load

Load command is used to load a program or a table. Folloearng is the syntax of Load command −

EXEC CICS LOAD
   PROGRAM ('name')
END-EXEC.

Relreare locatedve

Relreare locatedve command is used to relreare locatedve a program or a table. Folloearng is the syntax of Relreare locatedve command −

EXEC CICS RELEASE
   PROGRAM ('name')
END-EXEC.

Return

Return command is used to return the control to the next higher logical level. Folloearng is the syntax of Return command −

EXEC CICS RETURN
   PROGRAM ('name')
   COMMAREA (data-value)
   LENGTH (data-value)
END-EXEC.

Interval Control Operations

The interval control operations are of the folloearng 2 kinds −

ASKTIME

ASKTIME is used to request for current time and date or timestamp. We then move this particular value to the worcalifornia california king storage variable inpart the program. Folloearng is the syntax of ASKTIME command −

EXEC CICS ASKTIME
   [ABSTIME(WS-TIMESTAMP)]
END-EXEC.

FORMATTIME

FORMATTIME formats the timestamp into the requireddish coloured format based on the options, which can end up being YYDDD, YYMMDD, or YYDDMM for date. DATESEP indicates the separator for the DATE as does the TIMESEP variable for TIME. Folloearng is the syntax of FORMATTIME command −

EXEC CICS FORMATTIME
   ABSTIME(WS-TIMESTAMP)
   [YYDDD(WS-DATE)]
   [YYMMDD(WS-DATE)]
   [YYDDMM(WS-DATE)]
   [DATESEP(WS-DATE-SEP)]
   [TIME(WS-TIME)]
   [TIMESEP(WS-TIME-SEP)]
END-EXEC.

CICS – Temporary Storage

There are various scratch pads which are available in CICS for saving data or to transfer the data end up beingtween transworkions. There are five storage areas which are provided simply by CICS, which we will end up being speak about thereing in this particular module.

COMMAREA

The COMMAREA end up beinghaves like a scratch pad thead wear can end up being used to pbum data from one program to one more program, either wislim the exwork same transworkion or from various transworkions. It ought to end up being degreatd in the LINKAGE SECTION uperform DFHCOMMAREA name.

Common Work Area

Any transworkion in the CICS area can access Common Work Area and hence the format and use of it must end up being concurd upon simply by all transworkions in the system thead wear figure out there’s to use it. There is only one CWA in the entire CICS area.

Transworkion Work Area

Transworkion Work Area is used to pbum data end up beingtween the application programs thead wear are executed with in the exwork same transworkion. TWA exists only for the duration of transworkion. It’s dimension is degreatd in the Program Control Table.

Temporary Storage Queue

Temporary Storage Queue (TSQ) is a feature thead wear is provided simply by the Temporary Storage Control Program (TSP).

  • A TSQ is a queue of records thead wear can end up being maked, read and depermited simply by various tasks or programs in the exwork same CICS area.

  • A queue identifier is used to identify TSQ.

  • A record wislim a TSQ is identified simply by the relative posit down downion known as the item numend up beingr.

  • The records in TSQ, remains accessible until the entire TSQ is explicitly depermited.

  • The records in TSQ can end up being read sequentially or immediately.

  • TSQs may end up being composed in the main storage or the auxiliary storage in the DASD.

WRITEQ TS

This command is used to add items to an existing TSQ. Also, we can make a brand brand new TSQ uperform this particular command. Folloearng is the syntax of WRITEQ TS command −

Syntax

EXEC CICS WRITEQ TS
   QUEUE ('queue-name')
   FROM (queue-record)
   [LENGTH (queue-record-dimension)]
   [ITEM (item-numend up beingr)]
   [REWRITE]
   [MAIN /AUXILIARY]
END-EXEC.

Folloearng are the details of parameters used in the WRITEQ TS command −

  • The QUEUE is identified simply by the name which is mentioned in this particular parameter.

  • FROM and LENGTH options are used to specify the record thead wear is to end up being composed to the queue and it’s dimension.

  • If the ITEM option is specified, CICS bumigns an item numend up beingr to the record in the queue, and sets the data area suppare locatedd in thead wear option to the item numend up beingr. If the record starts a brand brand new queue, the item numend up beingr bumigned is 1 and subsequent item numend up beingrs follow on sequentially.

  • The REWRITE option is used to update a record already present in the queue.

  • MAIN / AUXILIARY option is used to store records in main or auxiliary storage. Default is AUXILIARY.

READQ TS

This command is used read the Temporary Storage Queue. Folloearng is the syntax of READQ TS −

Syntax

EXEC CICS READQ TS
   QUEUE ('queue-name')
   INTO (queue-record)
   [LENGTH (queue-record-dimension)]
   [ITEM (item-numend up beingr)]
   [NEXT]
END-EXEC.

DELETEQ TS

This command is used depermite the Temporary Storage Queue. Folloearng is the syntax of DELETEQ TS −

Syntax

EXEC CICS DELETEQ TS
   QUEUE ('queue-name')
END-EXEC.

Transient Data Queue

Transient Data Queue is transient in charworker as it can end up being maked and depermited fastly. It enables only sequential access.

  • The contents of the queue can end up being read only once as it gets destroyed once a read is performed and hence the name Transient.

  • It cannot end up being updated.

  • It requires an encheck in DCT.

WRITEQ TD

This command is used to write Transient data queues and they are always composed to a file. Folloearng is the syntax of WRITEQ TD command −

Syntax

EXEC CICS WRITEQ TD
   QUEUE ('queue-name')
   FROM (queue-record)
   [LENGTH (queue-record-dimension)]
END-EXEC.

READQ TD

This command is used read the Transient data queue. Folloearng is the syntax of READQ TD −

Syntax

EXEC CICS READQ TD
   QUEUE ('queue-name')
   INTO (queue-record)
   [LENGTH (queue-record-dimension)]
END-EXEC.

DELETEQ TD

This command is used depermite the Transient data queue. Folloearng is the syntax of DELETEQ TD −

Syntax

EXEC CICS DELETEQ TD
   QUEUE ('queue-name')
END-EXEC.

CICS – Intercommunication

The mutual communication thead wear conaspectrs place end up beingtween 2 or more systems is known as intercommunication.

Benefit’s of Intercommunication

The imslotant end up beingnefit’s of intercommunication are as follows −

  • We do not need to replicate the data on all the systems.

  • Users need not hold interinterconnections to multiple systems for accesperform the data storeddish coloured on all of them.

  • It improves the performance of the application.

Basic Terminologies

One must have a knowladvantage of fundamental terminologies used in the CICS system. Folloearng are the fundamental terms −

Local System

A local system is a system thead wear initiates a request for intercommunication.

Local Resource

A local resource is a resource thead wear are locateds on the local system.

Remote System

A remote system is a system thead wear is withinitiated as a result of an intercommunication request.

Remote Resource

A remote resource is a resource thead wear are locateds on the remote system.

MVS Sysplex

MVS Sysplex is a configuration of multiple MVS operating systems. They work as a performle system simply by sharing functions and programs.

CICSPlex

CICSPlex is commonly descriend up beingd as a set of interconnected CICS areas thead wear process customer workload. A CICSPlex is a set of interconnected CICS areas thead wear own Terminals, Applications, Resources, etc.

Intercommunication Methods

There are 2 ways in which CICS can communicate with other systems −

  • MRO − Multi Region Operation is used when 2 CICS areas wislim the exwork same MVSPLEX needs to communicate with each other.

  • ISC − Inter System Communication is used when a CICS area in a LOCAL server has to communicate with a CICS area in the REMOTE server.

CICS – Status Codes

While worcalifornia california king with CICS, you may encounter aend up beingnds. Folloearng are the common aend up beingnd codes with their own own description which will help you to resolve the issues −

Sr.No Code & Description
1

ASRA

Program Check Exception

2

AEI0

Program ID Error

3

AEI9

Map Fail condition

4

AEIO

Duplicate Key

5

AEIN

Duplicate Record

6

AEID

End of file reached

7

AEIS

File is not open up up

8

AEIP

Invalid request condition

9

AEY7

Not authorised to use the resource

10

APCT

Program not found

11

AFCA

Dataset not found

12

AKCT

Time away error

13

ABM0

Specified chart not found

14

AICA

Program in infinite loop

15

AAOW

Internal logic error

SHARE
Previous articleCompetitive Climbing
Next articleIMS DB

NO COMMENTS

LEAVE A REPLY