CICS

0
92

CICS – Overwatch

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

CICS Overwatch

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 king on CICS system but it gives a feel to user thead wear he is the single 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 iself, as it manages it is own processor storage, has it is own task manager which handles execution of multiple programs, and provides it is own file management functions.

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

  • CICS is a generalized transworkionion processing interface.

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

CICS – Environment

CICS it iself workions 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 under it. CICS runs as a batch job and we can watch 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 sign up fortly perform a task.

CICS Environment

Following are the services which we will end up being talk abouting 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 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 king. CICS tries to prioritize the response time to the the majority of important task.

  • Program Control − Program Control manages loading and releasing 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 tasks may need to use the exworkion exwork same application program, CICS loads only one duplicate of the code into memory. Each task threads it is way through this code independently, so many kind of users can all end up being running transworkionions thead wear are concurrently using the exworkion exwork same physical duplicate of an application program.

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

  • Interval Control − Interval Control away fromers 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 relresit downves application programs from the burden of dealing with terminal hardbattlee issues through the use of Basic Mapping Support (BMS).

  • CICS provides Multi Region Operation (MRO) through which more than one CICS area in the exworkion 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 talk abouting more in detail in upcoming modules.

Monitoring Services

Monitoring Services monitor various furthermorets 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 understandladvantage of the easy terms used in CICS to get a end up beingtter understanding 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 delicatebattlee is available which means thead wear furthermore normal PCs can end up being used as 3270 terminals. 3270 terminals are dumb terminals and do not do any kind of processing all of themselves. All processing needs to end up being done simply by the application program. IBM terminals consist of the following components −

CRT Monitor

The CRT monitor displays the outplace 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 following charworkioneristics −

  • It is capable of displaying 1920 charworkioners.

  • Each of these 1920 charworkioner posit down downions is wislimdividually adgownable.

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

  • The display charworkioneristics like intensit down downy, protected, non-protected of the field can end up being set using BMS which we will end up being talk abouting in detail in upcoming modules.

CICS CRT Monitor

Keyplank

IBM keyplank keys are divided into following two 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 using non-aid keys, CICS will not furthermore understand if the user is typing any kind ofslimg or not.

  • AID Keys − AID keys are understandn 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 two categories −

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

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

CICS Keyplank

Transworkionion

A CICS program is wislimvoked through a transworkionion. A CICS transworkionion is a collection of logically related programs in an application. The whole application could end up being logically divided into many transworkionions.

  • Transworkionion identifiers which are 1 to 4 charworkioners lengthy are used to identify the transworkionions which the users want to do.

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

Task

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

  • Users invoke an application simply by using one of the transworkionion identifiers. CICS looks up for the transworkionion identifier to find out which program to invoke 1st to do the work requested. It generates a task to do the work, and transfers control to the mentioned program.

  • A transworkionion can end up being comppermited through many 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. Transworkionion

The difference end up beingtween a transworkionion and a task is thead wear many users can invoke a transworkionion 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 many Logical Unit of Works in CICS. We will talk about more about it in upcoming modules.

Application

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

a

CICS – Nucleus

The five CICS system components descriend up beingd earsit downr are a convenient grouping of CICS system programs, each of which performs it is own specialised functions. The core of CICS understandn as the CICS Nucleus which consists of IBM-suppsit downd 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 generates the CICS system highly flexible and thus easy to maintain. Following are the important control programs of CICS −

TCP

TCP is understandn as Terminal Control Program.

  • TCP is used to receive messages from the terminal.

  • It maintains hardbattlee communication requirements.

  • It requests CICS to initiate the tasks.

KCP

KCP is understandn as Task Control Program.

  • KCP is used to simultaneously control the execution of tasks and it is related properties.

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

PCP

PCP is understandn 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 understandn 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 understandn as Storage Control Program. It is used to control allocation and deallocation of storage wislim a CICS area.

Control Tables

CICS consists of IBM-suppsit downd 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. Following are the important Control Tables −

TCT

TCT is understandn as Terminal Control Table.

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

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

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

PCT

PCT is understandn as Program Control Table.

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

  • TRANSID is unique in PCT table.

PPT

PPT is understandn as Processing 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 transworkionion and a corresponding program name is allocated to the transworkionion from the PCT. It checks if the program is loaded or not. If it is loaded, then the task use counter is wislimcrresit downved simply by 1. If the program is not loaded, then the program is 1st loaded and the task use counter is set to 1. It gets the load library adgown from the PPT table.

FCT

FCT is understandn as File Control Table.

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

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

Transworkionion

When a transworkionion identifier TP02 is entecrimson on the CICS terminal, 1st it checks if generally correct now there is a program bumociated with this Transworkionion 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 Transworkionion

Transworkionion Life Cycle

The transworkionion life cycle has the following steps −

CICS Transworkionion Life Cycle

Step 1

The terminal operator initiates the transworkionion simply by typing a 1 to 4 charworkioner transworkionion-id and pressing the ENTER key.

Step 2

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

  • Instructs the SCP to generate 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 following −

  • Validates the transworkionion-id and security.

  • Instructs the SCP to generate a task control area.

  • Assigns priority to the task based on Terminal priority (Set in TCT), Operator priority (Set in SNT), and Transworkionion 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 following −

  • 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 following −

  • 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 following −

  • Requests a File work area from the SCP.

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

Step 7

The KCP does the following −

  • 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 following −

  • 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 following −

  • Sends the outplace to the terminal.

  • Requests the SCP to relresit downve the TIOA.

CICS – Transworkionions

CICS transworkionions are used to perform multiple operations in the CICS area. We will end up being talk abouting the important CICS transworkionions suppsit downd simply by IBM in detail.

CESN

CESN is understandn 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 following screenshot shows how the sign-on screen looks like −

CICS CESN

CEDA

CEDA is understandn as CICS Execute Definition and Administration. It is used simply by CICS System Administrators to degood CICS table entries and other administration workionivities.

CEMT

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

  • Using CEMT command, we can manage transworkionions, tasks, files, programs, etc.

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

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

Example

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

CEMT 
  
** Press ENTER & Following 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 understandn as CICS Execute Command Interpreter. Many kind of CICS commands can end up being executed using CECI.

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

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

Example

Following example shows how to send chartped outplace data to terminal. We will end up being talk abouting about MAPS in the upcoming modules.

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

CEDF

CEDF is understandn 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 wislim EDF mode message will end up being displayed. Now kind the transworkionion id and press the enter key. After initiation, with each enter key, a series is executed. Before executing any kind of CICS command, it shows the screen in which we can modify the values end up beingfore proceeding further.

CMAC

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

Example

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

CMAC aend up beingnd-code

CESF

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

Example

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

CESF LOGOFF

CEBR

CEBR is understandn as CICS Execute Temporary storage Blinese. 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 generated and retrieved properly. We will talk about more about TSQ in the upcoming modules.

Example

Following 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 talk about a few easy features which will help us understand the concepts end up beingtter −

Multitascalifornia king

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

Multi-threading

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

Re-entrancy

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

Quasi-reentrancy

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

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

CICS – COBOL Basics

CICS programs are generated in COBOL language in Mainframes. We will end up being talk abouting about writing a easy COBOL-CICS program, compiling it, and then executing it.

CICS Program

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

Step 1

Login to Mainframes and open up a TSO Session.

Step 2

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

Step 3

Create a brand new memend up beingr inaspect the PDS and code the following 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 using the following 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 using the following command −

CEMT SET PROG(HELLO) NEW.

Step 7

Execute the program using the bumociated transworkionion-id. Transworkionion-id is provided simply by the Administrator. It will show the following outplace −

CICS Outplace

Program Compilation

The following 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 king the source code for syntax errors.

Linkage Editor

The function of a Linkage Editor is to link various object modules to generate a single load module.

CICS – BMS

BMS is understandn as Basic Mapping Support. An application consists of formatted screens which workion 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/outplace services. We use BMS to generate screen designs with proper posit down downions and attributes. Following are the functions of BMS −

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

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

  • BMS generates the application hardbattlee independent.

Formatted Screen

The screen shown end up beinglow is a Menu Screen and can end up being designed using BMS. It’s key points are as follows −

  • The screen could have a Title, date, and any 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 wislimplace is then sent to the CICS program for further processing.

  • At the underaspect of the screen, Action keys are displayed.

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

CICS Screen

BMS Basic Terms

Following are the easy terms which we will end up being using in the upcoming modules −

Map

Map is a single screen format which can end up being designed using BMS macros. It can have names containing 1 to 7 chars.

Mapset

Mapset is a collection of charts which are linked sign up fortly to form a load module. It ought to have a PPT entest. It can have names from 1 to 7 chars.

BMS Macros

BMS chart is a program which is generated in Assembly language to manage screens. The 3 macros thead wear are used to degood 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 entest in PPT table must end up being present. The following table shows the list of parameters which can end up being used in DFHMSD −

Sr.No Parameter & Description
1

TYPE

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

2

MODE

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

3

LANG

LANG = ASM/COBOL/PL1
It figure outs 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 exworkion exwork same storage base for the symbolic charts of from more than one chartset

5

CTRL

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

6

TERM

TERM = kind ensures device independence,requicrimson 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. Requicrimson for the CICS command level.

Example

The following 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 new chart. Mapname is followed simply by the DFHMDI macro. Mapname is used to send or receive charts. The following table shows the parameters which we use inaspect a DFHMDI macro −

Sr.No Parameter & Description
1

SIZE

SIZE = (Line,Column)
This parameter gives the size of the chart. BMS permit is us to generate a screen using many charts, and this parameter end up beingcomes important when we are using more than one charts in a single 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 proper simplyified.

5

CTRL

CRTL is used to degood the device control requests. If CTRL =
FREEKB – To unlock the keyplank
FRSET – To reset MDT to zero status
ALARM – To set an alequip 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. Requicrimson for the CICS command level.

Example

The following 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 degood field names. The field name is mentioned against which DFHMDF macro is coded. This field name is used inaspect the program. We do not write field name against constant field which we do not want to use inaspect the program. The following table shows the list of parameters which can end up being used inaspect 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 is 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 workionual data starts in column 2.

2

LENGTH

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

3

INITIAL

This is the charworkioner data for an outplace field. We use this to specify laend up beingls and titles for the screen and maintain all of them independent of the program. For the 1st 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 proper 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 entecrimson in this field. The cursor skips to the next field.

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

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

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

BRT – Bproper 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 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 workionually modified simply by the user.

6

PICIN

PICIN appsit down’s to the data field which is used as inplace like PICIN = 9(8).

7

PICOUT

PICIN appsit down’s to the data field which is used as outplace like PICOUT = Z(8).

Example

The following 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 entecrimson 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 outplace is sent to the symbolic chart. BMS will merge the outplace 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 about how the chart ought to end up being displayed.

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

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

  • It is coded using 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 duration of 10, this means thead wear the name field can conaspectr values whose duration cannot exceed 10. But when you display this chart using CICS and start entering values for this field on the screen, we can enter more than 10 Charworkioners, i.e., till the end of the screen and we can enter furthermore in the next series. To prfurthermoret this, we use Skipper field or endper field. A Skipper field would generally end up being an Unnamed field of duration 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 duration is reached, the cursor will automatically posit down downion to the next unprotected field. The following 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 endper field after the named unprotected field, then while entering the value, once the specified duration is reached, the cursor will end it is posit down downioning. The following example shows how to add a endper 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 field stores information about the physical properties of the field. The following diagram and the table exnormal 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 – Bproper
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 single bit. It specifies whether the value is to end up being transfercrimson to the system or not.

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

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

Send Map

The send chart command writes formatted outplace to the terminal. It is used to send the chart to the terminal from the application program. The following 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 following table lists the parameters used in a send chart command alengthy with their particular 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 exworkion exwork same as the chart name.

3

FROM

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

4

MAPONLY

It means thead wear no data from your own 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 generated. Only the data from your own 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 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 from the modified data tag in the attribute simply byte for all the fields on the screen end up beingfore whead wear you are sending is placed generally correct now 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 alequip to end up being sounded.

11

FREEKB.

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

12

PRINT

It permit is the outplace 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 outplace 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 exworkionly the exworkion exwork same meaning as for the SEND MAP command. The following 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 following steps are essential to generate and execute a chartset −

  • Step 1 − Open a TSO session.

  • Step 2 − Create a brand new PDS.

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

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

  • Step 5 − Open a CICS Session.

  • Step 6 − Install the program using the command −

    CEMT SET PROG(chartset-name) NEW

  • Step 7 − Type the following 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 interworkion with the CICS. EIB (Execute Interface Block) workions as an interface to permit application programs communicate with the CICS. EIB contains the information requicrimson 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 compilation error, but we may get unpcrimsonictable results. Following 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 particular own set of statements like READ, WRITE, REWRITE, and DELETE which we will end up being talk abouting in the upcoming modules.

  • File Section and Environment Division is not requicrimson.

  • 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 about transworkionion 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 exworkion exwork same EIB.

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

EIB Fields

The following 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 duration of DFHCOMMAREA
EIBDATE S9(7) COMP-3 It contains Current System Date
EIBRCODE X(6) It contains Return code of the final transworkionion
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) Transworkionion Identifier

CICS Programs Clbumification

CICS Programs are clbumified in the following 3 categories which we will talk about one simply by one −

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

Non Conversational Programs

While executing non-conversational programs, no individual being intervention is requicrimson. 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 generateed.

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

Example

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

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 points of a Conversational program are as follows −

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

  • The time conaspectrn simply by user to respond is understandn as Think Time. This time is conaspectrably 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 outplace.

  • 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 following example shows a conversion program which conaspectrs inplace from the user and then simply displays the exworkion exwork same inplace on the CICS terminal as outplace −

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 covecrimson non-conversion and conversion programs. Conversion programs have a major drawback as their particular besit downve time is conaspectrably high. To overcome this issue, pseudo-conversion programming came into the picture. We will now talk about more about pseudo-conversion programs.

Pseudo-Conversion Program

Following is the sequence of furthermorets which conaspectr place in a pseudo-conversion program −

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

  • Step 2 − The system allocates the resources used simply by this transworkionion to other transworkionions 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 outplace is displayed.

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

CICS Pseudo Conversion Program

Pseudo Conversion Techniques

The important point to note in pseudo-conversation is pbuming of data end up beingtween every task. We will talk about about the techniques for pbuming data.

COMMAREA

COMMAREA is understandn as communication area. COMMAREA is used to pbum data end up beingtween tasks. The following example shows how to pbum COMMAREA where WSCOMMAREA and WS-COMMAREA-LENGTH are declacrimson in Worcalifornia king Storage Section −

EXEC CICS RETURN
   TRANSID ('transworkionion-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 exworkion exwork same transworkionion or in various transworkionion furthermore.

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

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

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

MOVE DFHCOMMAREA TO WS-COMMAREA.

Example

After sending the chart, the task ends and wait is for the user response. At this stage, the data needs to end up being saved, end up beingcause though the task has ended, the transworkionion has not. When this transworkionion 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 following 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-transworkionion-id1> to WS-COMMAREA
   STEP3: ISSUE CONDITIONAL RETURN
ELSE
   IF WS-COMMAREA = <internal-transworkionion-id1> 
      STEP4: RECEIVE MAP
      STEP5: PROCESS DATA
      STEP6: SEND OUTPUT MAP
      STEP7: MOVE <internal-transworkionion-ID2> to WS-COMMAREA
      STEP8: ISSUE CONDITIONAL RETURN 
   END-IF
END-IF      
STEP9: REPEAT STEP3 TO STEP7 UNTIL EXIT

Example

The following 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

Following are the advantages of pseudo conversion −

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

  • It looks as if it is wislim conversational mode.

  • It has end up beingtter response time.

Return Statements

Following are the two kinds of return statements which are used in CICS −

Return-1

When the following unconditional return statement is issued, the task and the transworkionion (program) is terminated.

EXEC CICS RETURN 
END-EXEC.

Return-2

When the following 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 transworkionion 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 talk abouted in earsit downr modules, AID keys are understandn 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 using EIBAID.

  • EIBAID is one simply byte lengthy and holds the workionual 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 following statement −

    COPY DFHAID

DFHAID

DFHAID is a duplicatebook which is used in application programs to include CICS pre-coded set of variables. The following 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 following 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 two 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 following 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. Following 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 requicrimson can end up being chosen from the list and moved to the symbolic field variable suffixed with 'A'.

DFHATTR holds the following 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 permit is us to access file data in many kind of ways. Most file accesses are random in onseries system as the transworkionions to end up being processed are not batched and sorted into any kind of kind of order. Therefore CICS supports the usual immediate access methods − VSAM and DAM (Direct Access Method). It furthermore permit is us to access data using database managers.

Random Access

Following are the commands which are used for random processing −

Sr.No Commands & Description
1 READ

READ command reads data from a file using primary key.

2 WRITE

Write command is used to add 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

Following are the commands which are used for sequential processing −

Sr.No Commands & Description
1 STARTBR

STARTBR is understandn as start blinese.

2 READNEXT / READPREV

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

3 RESETBR

The RESETBR command permit is us to reset our starting point in the middle of a blinese.

4 ENDBR

When we have finished reading a file sequentially, we terminate the blinese using the ENDBR command.

CICS – Error Handling

There are many kind of kinds of aend up beingnds and errors which one can face while using a CICS application. Errors can arise because of to both hardbattlee of delicatebattlee issues. We will end up being talk abouting about errors and error handling in this module.

CICS Errors

Following 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 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 charworkioner in numeric field, or transworkionion id error.

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

Error Handling Commands

CICS provides many mechanisms to identify the errors and to handle all of them in our programs. Following 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-outplace error, then it can end up being handimmediateed using 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 workionion to end up being conaspectrn if a particular aend up beingnd or error happens which is mentioned inaspect the Ignore Condition.

5 Nohandle

Nohandle can end up being specified for any 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 entest in the Processing Program Table. Following are the commands which are used for program control services −

  • XCTL
  • Link
  • Load
  • Relresit downve
  • Return

Program Logical Levels

The application programs which execute under CICS have various logical levels. The 1st 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 king program. The XCTL programs run at the exworkion exwork same level. It will end up being clear when we will go through Link and XCTL, later in this module. The following 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 exworkion 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 following 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 following 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. Following is the syntax of Load command −

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

Relresit downve

Relresit downve command is used to relresit downve a program or a table. Following is the syntax of Relresit downve command −

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

Return

Return command is used to return the control to the next higher logical level. Following 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 following two kinds −

ASKTIME

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

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

FORMATTIME

FORMATTIME formats the timestamp into the requicrimson 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. Following 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 transworkionions. There are five storage areas which are provided simply by CICS, which we will end up being talk abouting in this 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 exworkion exwork same transworkionion or from various transworkionions. It ought to end up being degoodd in the LINKAGE SECTION using DFHCOMMAREA name.

Common Work Area

Any transworkionion 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 transworkionions in the system thead wear figure outs to use it. There is only one CWA in the entire CICS area.

Transworkionion Work Area

Transworkionion Work Area is used to pbum data end up beingtween the application programs thead wear are executed with in the exworkion exwork same transworkionion. TWA exists only for the duration of transworkionion. It’s size is degoodd 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 generated, read and depermited simply by various tasks or programs in the exworkion 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 understandn 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 generated 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 generate a brand new TSQ using this command. Following is the syntax of WRITEQ TS command −

Syntax

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

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

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

  • FROM and LENGTH options are used to specify the record thead wear is to end up being generated to the queue and it is duration.

  • If the ITEM option is specified, CICS bumigns an item numend up beingr to the record in the queue, and sets the data area suppsit downd in thead wear option to the item numend up beingr. If the record starts a 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. Following is the syntax of READQ TS −

Syntax

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

DELETEQ TS

This command is used depermite the Temporary Storage Queue. Following 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 character as it can end up being generated and depermited quickly. It permit is 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 entest in DCT.

WRITEQ TD

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

Syntax

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

READQ TD

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

Syntax

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

DELETEQ TD

This command is used depermite the Transient data queue. Following 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 two or more systems is understandn as intercommunication.

Benefit is of Intercommunication

The important end up beingnefit is of intercommunication are as follows −

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

  • Users need not hold connections to multiple systems for accessing the data stocrimson on all of them.

  • It improves the performance of the application.

Basic Terminologies

One must have a understandladvantage of easy terminologies used in the CICS system. Following are the easy 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 sit down’s on the local system.

Remote System

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

Remote Resource

A remote resource is a resource thead wear sit down’s on the remote system.

MVS Sysplex

MVS Sysplex is a configuration of multiple MVS operating systems. They work as a single 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 two ways in which CICS can communicate with other systems −

  • MRO − Multi Region Operation is used when two CICS areas wislim the exworkion 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 king with CICS, you may encounter aend up beingnds. Following are the common aend up beingnd codes with their particular 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

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 out error

13

ABM0

Specified chart not found

14

AICA

Program in infinite loop

15

AAOW

Internal logic error

SHARE
Previous articleGolf
Next articleWhat is AJAX?

NO COMMENTS

LEAVE A REPLY