0% found this document useful (0 votes)
19 views69 pages

CICS So Far

CICS, or Customer Information Control System, is an OLTP system developed by IBM in 1960 that manages information in an online environment, providing database and communication functions. It supports various transaction types, including non-conversational, conversational, and pseudo-conversational transactions, and operates under mainframe systems like MVS or z/OS. CICS offers a range of services for application programming, data communication, and management, utilizing various tables to control transactions, programs, and terminals.

Uploaded by

Richard Benjamin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views69 pages

CICS So Far

CICS, or Customer Information Control System, is an OLTP system developed by IBM in 1960 that manages information in an online environment, providing database and communication functions. It supports various transaction types, including non-conversational, conversational, and pseudo-conversational transactions, and operates under mainframe systems like MVS or z/OS. CICS offers a range of services for application programming, data communication, and management, utilizing various tables to control transactions, programs, and terminals.

Uploaded by

Richard Benjamin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 69

CICS

Customer Information Control System


What is CICS?

• CICS stands for Customer Information Control System

• Developed in 1960 by IBM

• CICS is and OLTP system designed to control information in an online environment by providing database and
data communication functions.

• CICS provides an interface between application programs and operating system services, such as data access
and communication access.

• On a mainframe, CICS runs under an operating system like MVS or OS/390 or z/OS. Although CICS runs as a
batch job, it can handle hundreds of interactive users that are using a variety of applications.
CICS Interface
CICS Services

• Telecommunication

• Multitasking

• Multithreading

• Data Access and Transaction Control

• Inter-system Communication
Non-Conversational Transaction

• In a non-conversational transaction the requirement is immediate and only infrequently requires further
follow-up

• They make least demand on the computing resources

• Usually one-time queries and much quicker to execute

• Easier to develop, test, document and maintain


Conversational Transaction

• A conversational transaction is an online transaction that sits idle while it waits for the user input

• In a conversational program, the initial map is sent to the terminal first and it waits for the user input. It
retrieves the input data from the terminal, processes the data and sends its output to the terminal and waits
again.

• While the conversational program waits for the user’s input, the task associated with that program remains in
storage. Because of that, conversational programs are inefficient in terms of virtual storage usage.

• Not ideal in a computing world where it makes unusual demands on the resources
Conversational Transaction - Illustration
Conversational Transaction - Processing
Pseudo-Conversational Transaction

• Common transaction technique used by CICS

• Achieved by relinquishing the control of computer resources till the terminal user responds back

• In pseudo-conversational programming, a program ends after it sends data to the terminal. This releases some
of the resources that are used by the program. Then, CICS restarts the program when the user completes an
entry and presses one of the terminal’s attention identifier (AID) keys.

• This technique appears to be fully conversational for the terminal user


Pseudo-Conversational Transaction - Processing
About 3270 Terminals

• The 3270 Information Display System is a family of


display and printer terminals.

• Today 3270 emulation software makes it possible


for PCs to be used as 3270 terminals.

• Two ways to connect 3270 emulation software to


CICS – using LAN/WAN and Internet/Intranet

• The screen of 3270 can display 1920 characters in


24 rows and 80 columns

• Each of these 1920 positions is individually


addressable
IBM Keyboard

• Attention Identifier (AID) keys

 Program Function (PF) keys – PF1 to PF24 and ENTER

 Program Access (PA) keys – PA1 to PA3 and CLEAR

• Non-Attention Identifier keys

 All other keys for alphabets, numbers, punctuations, etc.


About 3270 Terminals – Alternate User Interfaces

• For 3270 terminal usage, CICS provides both presentation logic and business logic

• CICS can also be used with other types of user interfaces where in the front-end program provides the
presentation logic and CICS provides the business logic
Application, Transaction and Task

• Application – An application is a collection of programs which accomplishes some specific user work

• Transaction – A CICS transaction is a collection of logically related programs in an application. A transaction in


CICS is identified by a transaction identifier that is 1 to 4 characters long.

• Task – A task is a single execution of some type of transaction


Logical Unit of Work (LUW)

• A Logical Unit of Work (LUW) is a piece of work like file update, database update which when done, is fully
done or not done at all

• In CICS, a task can contain several LUW’s

• It starts when the first CICS command is executed in the present task and ends when a SNYCPOINT (with or
without rollback) is executed

• If a SYNCPOINT is not issued in the program, then at the end of the task, CICS issues an auto SYNCPOINT on
successful completion and a ROLLBACK on an abend
Transaction internals in CICS

• Each transaction is identified by a unique four


character identifier called a transaction
identifier or trans-id. To start a transaction, the
user enters its trans-id at a terminal.

• Transactions are defined in a CICS table called


the Program Control Table (PCT). Each trans-id in
the PCT identifies the program CICS should
execute when the transaction is invoked.

• Programs are defined in the Processing Program


Table (PPT). This table keeps track of which
programs are already loaded into the storage. If
a program has not been loaded, it is loaded
when its associated transaction is invoked.
CICS Services – Application Programming Interface

• CICS provides many services that are available to


an application program through its Application
Programming Interface (API). This API insures
that all the services are invoked in a consistent
manner

• The data communication services allow users to


communicate with programs through their
terminals

• The data management services lets programs


access data stored in files or databases

• The CICS management services provide a variety


of services for managing the execution of the
application programs.
CICS Services – Data Communication Services

• Terminal control provides the interface between CICS and


the operating system’s telecommunication access method. It
lets you send or receive text from the terminal that initiated
the task.

• Most common telecommunication access methods are


VTAM, SNA and TCP/IP. Some of the access methods can be
used in combination with each other.

• Basic Mapping Support (BMS) provides the interface


between application programs and terminal control. It lets
you create maps that specify the position and the
characteristics of the individual display elements on the
terminal screen.

• Each terminal in CICS system must be defined in the


Terminal Control Table (TCT). Each terminal in this table is
assigned a unique one to four character terminal identifier
or term-id.
CICS Services – Data Management Services

• CICS provides three services to manage data – file control,


SQL and DL/I.

• File Control passes data requests made by a program to


VSAM. VSAM in turn manages the data stored in files or
direct access devices.

• Each file accessed by CICS must be defined in the File


Control Table (FCT). The FCT specifies the file name along
with other information like the file type and the operations
that can be performed on the file.

• SQL passes data requests made by a program to IBM’s


relational database system DB2.

• DL/I passes data request made by a program to IBM’s


hierarchical database system IMS.
CICS Tables
Table Name Purpose
PCT (Program Control Table) The transactions and the main program associated with that transaction are
registered in this table
PPT (Processing Program Table) All CICS programs and MAPS have to be registered in this table
FCT (File Control Table) All files used in a CICS program must be registered in this table
RCT (Resource Control Table) It controls the CICS DB2 interface. All DB2 plans are registered in this table.
TCT (Terminal Control Table) Register all terminals which are under CICS control. CICS Terminal Control
Program (TCP) uses this table for identifying the terminals and performing all
input/output operations against these terminals.
DCT (Destination Control Table) TDQs should be predefined in the destination control table. Transient Data
Program (TDP) is the program that refers the DCT and performs the input/output
operations on the TDQs.
TST (Temporary Storage Table) Temporary Storage Queues (TSQs) are registered in this table
CICS Management Services

Management Service Description


Program Control Manages the programs executing within a task. With this service, programs can call or transfer control to other
programs.
Temporary Storage Control Provides a simple way to store data outside the working storage area of a program. The data is stored in simple files
called temporary storage queues.
Interval Control Provides time related services, including services for getting the current date and time and scheduling tasks for
execution.
Storage Control Provides for allocating main storage space outside of the working storage area of an application program.

Task Control Used to control the execution of a task. Provides for temporarily suspending a task that is monopolizing CICS
resources or gaining exclusive control of a CICS resource.
Dump Control Provides a transaction dump when a fatal error is encountered during the execution of an application program. The
dump can then be used to help debug the program.
Trace Control Maintains a trace table that indicates the sequence of CICS operations performed. This table can be used to help
debug a program.
Journal Control Creates a record or journal that can be used to restore files in the event of a task or system failure.

Transient Data Control Provides a convenient way to use sequential files called destinations to store data. Records written to a destination
are added to the end of the destination. Records are read sequentially from a destination and then deleted.
Multitasking in CICS

• Multitasking means that CICS allows more than one task to be executed at the same time

• Although all of the operating systems that support CICS are capable of multitasking on their own, CICS
provides multitasking within the single address space provided by the operating system.
Multithreading in CICS

• Multithreading allows all the users in a CICS region to


use the same copy of a program at the same time.

• For multithreading to work, the program must be


reentrant.
Basic Mapping Support (BMS)

• Basic Mapping Support (BMS) provides an interface between terminals and application programs

• BMS provides for device independence. It inquires the target device and converts the data stream appropriately

• BMS is the presentation manager of CICS.


Basic Mapping Support (BMS) – Attribute Bytes

• An attribute byte is an extra 1 byte for each field that stores information about the physical properties of the field

• Most common possible attributes include:

 Protected
 Unprotected
 Dark
 Bright
 Numeric
 Askip
 Modified Data Tag
Basic Mapping Support (BMS) – Attribute Bytes
Basic Mapping Support (BMS) – Attribute Bytes

Example – 1

Example – 2
Basic Mapping Support (BMS) – Attribute Bytes

• A common practice in designing terminals screen is to define:

 Title fields as protected (blue)


 Data entry fields as unprotected (green)
 Data entry fields in error as unprotected/bright (red)
 If the screen has a field for error messages, this is often defined as protected/bright (white)

• In addition to the field attributes some 3270 terminals have extended attributes as well like extended colors (blue,
pink, etc.) , extended highlighting (flashing, underscoring, etc.) and so on.
Basic Mapping Support (BMS) – Macros

• There are 3 macros used to define a map

• DFHMSD – defines a mapset


• DFHMDI – defines a map
• DFHMDF – defines a field with its characteristics in a map

• The format of a BMS mapset may look something like below


TITLE <optional>
PRINT NOGEN <optional>
mapsetid DFHMSD ….
mapname1 DFHMDI ….
fldname1 DFHMDF ….
fldname2 DFHMDF ….
fldname3 DFHMDF ….
DFHMSD TYPE=FINAL
END
Basic Mapping Support (BMS) – Macro Coding Rules

• Columns 1 to 71 are where you code your assembler statements


• Column 72 is for a continuation marker if you need to continue in the next line
• Column 73 to 80 called the identification-sequence field can be used for any purpose but usually contains the
sequence numbers
• Continuing a line – The text of the continuation line must start in column 16. To continue a line, any character can be
placed in column 72 except blank.
• Commenting a line – Comment lines are indicated by placing an asterisk (*) in column 1. A comment line cannot be
placed between continuation lines and comment lines cannot be continued
• The statement consists of four components – the label starting in column 1 (with a max length of 7 chars), the
mandatory operation specifying the assembler instruction or macro, the operands which specify the parameters and
an optional comment.
Basic Mapping Support (BMS) – Example Map
Physical vs Symbolic Map
Physical vs Symbolic Map - Illustration
Basic Mapping Support (BMS) – DFHMSD

• DFHMSD macro defines a mapset


• Defines the global information that applies to all maps within the mapset
• There are two formats of the DFHMSD – one for beginning a mapset and the other to end a mapset

Format – 1

Format – 2
Basic Mapping Support (BMS) – DFHMSD keywords

Keyword Description
TYPE=&SYSPARM|DSECT|MAP|FINAL MAP generates only a physical map
DESCT generates only a symbolic map
&SYSPARM generates both physical and symbolic maps
FINAL ends a mapset
LANG=COBOL|ASM|PLI|C Specifies in what language the symbolic map to be generated
MODE=INOUT|IN|OUT IN – map is used only for input
OUT – map is used only for output
INOUT – map is used for both input and output
TERM=termtype Termtype specifies the terminal type
TIOAPFX=YES|NO YES – filler is included in the symbolic map
NO – filler is not included in the symbolic map
STORAGE=AUTO|BASE=dataname AUTO – separate memory is acquired for each symbolic map in the mapset
BASE – same memory area is used for each symbolic map
Basic Mapping Support (BMS) – DFHMSD keywords

Keyword Description
CTRL=([FREEKB][ALARM][FRSET][PRINT][,length] FREEKB – unlock a keyboard after a SEND command
ALARM – terminal alarm is to sound when a map is sent
FRSET – prior to SEND MAP instruction, the MDT attribute
flags at the terminal are to be reset
PRINT – mapset to be sent to the printer
Length – line length on the printer
Basic Mapping Support (BMS) – DFHMDI

• DFHMDI defines the basic attributes of a single map


Basic Mapping Support (BMS) – DFHMDI keywords

Keyword Description
SIZE=(line,column) Specifies how much screen is to be covered – the number of rows and columns
LINE=number Line number where the map starts
COLUMN=number Column number where the map starts
Basic Mapping Support (BMS) – DFHMDF

• DFHMDF macro defines a field with its characteristics on a map


Basic Mapping Support (BMS) – DFHMDF keywords
Keyword Description
POS=(line,column) Starting position of the field from the top left corner of the map
LENGTH=number Number of bytes for the field
INITIAL=‘literal’ Initial field value. Generally used for title fields.
ATTRB=([ASKIP|PROT|UNPROT][,BRT ASKIP – field is protected from data entry. Used for title fields.
|DRK|NORM][,NUM][,FSET][,IC]) PROT – field is protected from data entry. Used for fields like date or time.
UNPROT – used for data entry fields
BRT – field to be displayed in high intensity
DRK – field should not be displayed
NORM – field to be displayed with normal intensity
NUM – allows only numeric characters to be entered
FSET – MDT to be turned on in the attribute byte
IC – Cursor to be positioned on this field
JUSTIFY=(LEFT|RIGHT[,BLANK|ZERO]) Determines whether on a RECEIVE command, fields are left or right
justified and whether they are padded with spaces or zeroes
PICIN=‘COBOL PIC value’ Applies to the data field which is used as input
PICOUT=‘COBOL PIC value’ Applies to the data field which is used as output
Basic Mapping Support (BMS) – Examples

• Mapset name is ERC1500 and the load


module will be ERC1500M
ERC1500 DFHMSD TYPE=&SYSPARM, X • Generates both physical and symbolic map
MODE=INOUT, X • Map is used for both input and output
LANG=COBOL, X • Language of the application program is
TERM=3270-2, X
TIOAPFX=YES, X
COBOL
CTRL=(FREEKB) • Terminal type is 3270-2
• Specifies that the filler of 12 bytes is
included in the symbolic map
• Unlocks a keyboard after a SEND command
Basic Mapping Support (BMS) – Examples

• Mapset name is MAPSET1 and the load


module will be MAPSET1M
• Generates both physical and symbolic map
MAPSET1 DFHMSD TYPE=&SYSPARM, X • Map is used for both input and output
MODE=INOUT, X • Language of the application program is
LANG=COBOL, X COBOL
TERM=3270, X
TIOAPFX=YES, X • Terminal type is 3270
STORAGE=AUTO X • Specifies that the filler of 12 bytes is
CTRL=(FREEKB,FRSET) included in the symbolic map
• Separate memory is acquired for each
symbolic map in the mapset
• Unlocks a keyboard after a SEND command
and prior to SEND command the MDT
attribute flags are reset
Basic Mapping Support (BMS) – Examples

• Title “Salary:” will appear in positions 11


through 17 of row 6
• The data entry field begins in column 19 of
DFHMDF POS=(6,10), X row 6
LENGTH=7,INTIAL=‘Salary:’ • The data field allows entering a value and
SALARY DFHMDF POS=(6,18),LENGTH=5, X
ATTRB=(UNPROT,NUM) only numeric characters are to be entered.
DFHMDF POS=(6,24),LENGTH=1 The value is right justified filling zeroes in
the high-order positions
• The attribute byte that terminates the field
is position 24 of row 6 restoring the screen
to ASKIP and NORM
Basic Mapping Support (BMS) – Examples

STUMST1 DFHMSD TYPE=&SYSPARM,MODE=INOUT, X


LANG=COBOL, TERM=3270, X
TIOAPFX=YES,CTRL=(FREEKB), X
STORAGE=AUTO
STUMAP1 DFHMDI SIZE=(24,80)
DFHMDF POS=(6,14),LENGTH=13, X
INITIAL=‘Student name:‘
STUNA DFHMDF POS=(6,28),LENGTH=20,
ATTRB=(UNPROT)
DFHMDF POS=(6,49),LENGTH=1
DFHMDF POS=(8,14),LENGTH=15, X
INITIAL=‘Year of study:‘
YOS DFHMDF POS=(8,30),LENGTH=7, X
ATTRB=(UNPROT,NUM)
DFHMDF POS=(8,38),LENGTH=1
DFHMDF POS=(10,14),LENGTH=15, X
INTITIAL=‘Specialization:‘
SPECLZ DFHMDF POS=(10,30),LENGTH=20, X
ATTRB=(UNPROT)
DFHMDF POS=(10,51),LENGTH=1
DFHMDF POS=(24,5),LENGTH=20, X
INITIAL=‘Press PF3 to exit’
DFHMSD TYPE=FINAL
END
Basic Mapping Support (BMS) – Skipper and Stopper Fields

Skipper Field Stopper Field

If we place a skipper field after the named If we place a stopper field after the named
unprotected field, then while entering the value, unprotected field, then while entering the value,
once the specified length is reached, the cursor once the specified length is reached, the cursor
will automatically position to the next unprotected will stop its positioning
field
NUM DFHMDF POS=(10,10), X
NUM DFHMDF POS=(10,10), X LENGTH=5, X
LENGTH=5, X ATTRB=(UNRPOT)
ATTRB=(UNRPOT) DFHMDF POS=(10,17), X
DFHMDF POS=(10,17), X LENGTH=1, X
LENGTH=1, X ATTRB=(PROT)
ATTRB=(AKSIP)
DFHBMSCA
• CICS provides the standard attribute character list in the form of a copy library member named DFHBMSCA
• The list covers the most required attribute characters for an application program
• The list can be used by copying DFHBMSCA into the WORKING-STORAGE SECTION of the application program through
the COPY statement.
WORKING-STORAGE SECTION.
...
COPY DFHBMSCA.
DFHBMSCA – Example

• If the selection field name is SELECTM, then executing the below statement before sending the map to the
terminal, would make the field unprotected bright and also sets the MDT tag off.
MOVE DFHBMBRY TO SELECTMA
The SEND MAP command
• The SEND MAP command sends a map to the terminal
• It sends mapped data to the terminal through application program
The SEND MAP command

Keyword Description
MAP(mapname) Specifies the name of the map to be sent to the terminal. This can be either a literal or a
dataname containing the literal.
MAPSET(mapsetname) Specifies the name of the mapset. It can be a literal or a dataname containing the literal.
FROM(dataname) Specifies the 01-level dataname from the symbolic map. Not to be used if MAPONLY is
specified.
LENGTH(value) Specifies the length of the data area that is to be formatted. It should not exceed the
length of the FROM data area.
DATAONLY Specifies only application program data to be written
MAPONLY Specifies only default map data to be written to the screen. It does not add any data from
the application program to the screen if MAPONLY is specified.
CURSOR(value) Specifies the cursor position in the map when SEND MAP is executed. If no value is
specified, then the cursor will be positioned at the first unprotected field of the map.
FREEKB Specifies that the keyboard is to be unlocked when the map is sent to the terminal
The SEND MAP command

Keyword Description
ALARM Specifies the alarm on the terminal to be activated when sending the map
FRSET Specifies to reset all the Modified Data Tags (MDT) of all current map fields in the terminal
buffer
ERASE Specifies to erase the screen buffer and print buffer before sending the map to the screen
ERASEAUP Erases all the unprotected fields on the screen before sending the map to the screen
HANDLE This is default. CICS will apply it if this is not specified.
NOHANDLE NOHANDLE indicates to CICS that all condition codes are to be ignored by CICS letting the
application handle them. NOHANDLE on a CICS command should include the additional
keyword RESP(dataname).
RESP(dataname) RESP indicates that CICS should place the condition code (the response code) in a COBOL data
area. These two keywords can be used with any CICS command. RESP must point to a full-
word data item PIC S9(8) COMP.
SEND MAP – Logical Steps
1. CICS constructs the data stream using MAP. Data fields containing LOW-VALUES are not included
2. Attribute bytes from the symbolic map replace those in the map if the attribute byte fields in symbolic map
are not LOW-VALUES
3. The first length field in the symbolic map that has -1 as its value becomes the cursor position, overriding any
specified in the MAP.
4. Using options in the SEND MAP command, the data stream is sent to the terminal
SEND MAP – Examples
EXEC CICS SEND MAP(‘ERC1502’)
MAPSET(‘ERC1500’) • Sends both physical and symbolic map
FROM(ERC1502I) • Erases the screen before before displaying map on the
ERASE screen
CURSOR • Places the cursor on the first field whose length field is -1
END-EXEC

EXEC CICS SEND MAP(‘ERC1502’)


MAPSET(‘ERC1500’)
FROM(ERC1502I) • Sends only the symbolic map i.e., sends only the data fields
DATAONLY • Places the cursor on the first field whose length field is -1
CURSOR
END-EXEC
SEND MAP – Examples

EXEC CICS SEND MAP(‘ERC1502’)


MAPSET(‘ERC1500’) • Sends both physical and symbolic
FROM(ERC1502I) map
ERASE • Erases the screen before before
CURSOR displaying map on the screen
NOHANDLE • Places the cursor on the first field
RESP(CICS-RESP-CODE) whose length field is -1
END-EXEC • Application program to handle the
CICS response code
IF CICS-RESP-CODE = DFHRESP(INVMPSZ)
code to handle error condition goes here
END-IF
The RECEIVE MAP command
• THE RECEIVE MAP receives the information entered by the user into the application program i.e., it receives
the screen input into the application program
• Along with the RECEIVE MAP command, the cursor position will be placed in the EIBCPOSN and the terminal
attention identifier information is stored in EIBAID.
The RECEIVE MAP command

Keyword Description
MAP(mapname) Specifies the map name that is used to identify the map
MAPSET(mapsetname) Specifies the mapset name
INTO(dataname) Specifies the data area where the data received from the screen needs to be written
SET(ptr-ref) Specifies the pointer reference to the map data stored in the memory location
ASIS Specifies lowercase data in the input is not converted to uppercase
RECEIVE MAP – Logical Steps
1. CICS receives the terminal input when the user presses an AID key.
2. CICS updates the EIB (Executive Information Block) and then initiates the transaction identified for this
terminal from the previous RETURN TRANSID command
3. When the application issues a RECEIVE MAP command, CICS formats the data into the symbolic map
identified in the RECEIVE command
RECEIVE MAP – Examples

EXEC CICS RECEIVE MAP(‘ERC1502’)


MAPSET(‘ERC1500’)
INTO(ERC1502I)
NOHANDLE
RESP(CICS-RESP-CODE)
END-EXEC • Receives the map
• Application program to handle the CICS response code
IF CICS-RESP-CODE = DFHRESP(MAPFAIL)
insert logic here to ensure no data processing
occurs and that a SEND MAP is reinitiated to
establish the titles and data fields
END-IF
Execute Interface Block (EIB) - DFHEIBLK

• Execute Interface Block (EIB) is a CICS area that contains information related to the current task
• There is one EIB for each task and it exists for the duration of that task
• Every program that executes as part of the task has access to the same EIB
• The fields of EIB can be addressed directly in a COBOL program
• The fields in EIB should only be read and not try to modify them
Execute Interface Block (EIB) - DFHEIBLK

Keyword Description
EIBAID Attention identifier that tells which keyboard key was used to transmit the last input
EIBCALEN Length of the communication area (COMMAREA)
EIBCPOSN Position of the cursor at the time of the last input command. Expressed as single number
relative to the position 0 on the screen.
EIBDATE The date on which the current task started
EIBTIME The time at which the current task started
EIBTASKN The task number that is a 7-digit packed decimal number. CICS assigns a sequential
number to each task it executes.
EIBTRMID The name of the terminal associated with the task. This name is 4 characters long.
EIBTRNID The transaction identifier of the current task. This is 4 characters long.
Execute Interface Block (EIB) – EIBAID and DFHAID

• EIBAID is one byte long and holds the actual identifier value used in the 3270 input stream.
• DFHAID is a copybook that is used in the application programs to include CICS pre-coded set of variables
SEND CONTROL
• CICS SEND CONTROL is a terminal output command
• It sends control information to the terminal without sending any data
Positioning the cursor
• Static Cursor Positioning
ITEMNO DFHMDF POS=(6,15)
Achieved by setting the attribute option IC in LENGTH=8
the DFHMDF macro definition for that field ATTRB=(UNPROT,FSET,IC)
….

• Relative/Direct Cursor Positioning EXEC CICS SEND MAP(‘ADMMAP1’)


MASET(‘ADMSET1’)
Use CURSOR option of the SEND MAP FROM(ADMMAP4)
command CURSOR(120)
END-EXEC.
Displacement=(RowN – 1) * 80 + (ColN – 1)

MOVE -1 TO EMPNOL.
• Dynamic/Symbolic Cursor Positioning EXEC CICS SEND MAP(‘EMPMAP1’)
MAPSET(‘EMPSET1’)
Move -1 to the corresponding length field in
FROM(EMPMAP1I)
the symbolic map to inform CICS to position CURSOR
the cursor at that field END-EXEC.
Map related errors

Error Description
MAPFAIL MAPFAIL occurs if the data mapped is of length zero. On a RECEIVE MAP command when there is no data
to be transferred to your program from the screen, this error occurs.
INVMPSZ Stands for Invalid Map Size. The error occurs in the below two scenarios:
MAP is too wide for the terminal
MAP is too long for the terminal
INVREQ This error occurs in below scenarios depending on the RECEIVE MAP conditions
1. RECEIVE MAP command issued in task which is not related to the terminal
2. Remotely linked program tries to execute RECEIVE MAP command
LENGERR This error occurs when the LENGTH option is zero or negative in a SEND MAP
CICS Application Programming
• Reentrant Program
A program is said to be reentrant if it does not modify itself and can reenter in itself and resume
processing after an interruption
• Quasi-Reentrant Program
A quasi-reentrant program is a reentrant program under CICS environment. CICS ensures reentrancy by
acquiring a unique storage area for each task. Between CICS commands, the CICS has the exclusive right to
use the CPU resources and it can execute other CICS commands of other tasks.
CICS Application Programming
Passing data between transactions

• Communications area (COMMAREA)


• Temporary Storage
• Application Dataset
CICS RETURN
• Returns a program’s control back
• If the program is triggered from a LINK command, then control returns to the calling program
• If the program is directly triggered from a transaction, then the control will return to CICS

Keyword Description
TRANSID The next transaction id to be executed at the terminal
COMMAREA The communication area which is to be made available to the invoking program. In the invoking
program the data area is in DFHCOMMAREA of the LINKAGE SECTION.
LENGTH The length of the COMMAREA in bytes
CICS RETURN

EXEC CICS RETURN • Unconditional return statement


END-EXEC • The task and the transaction (program) are
terminated

EXEC CICS RETURN • Conditional return statement


TRANSID(WS-TRANID) • Control returns to CICS with the next transaction-id
COMMAREA(WS-COMMAREA) to be executed
END-EXEC • The next transaction starts when the user presses
an AID key
Creating a CICS Application Run Unit

Source Program

CICS Translator Listing

Translated
Source Program

PRECOMPILE Listing

Database Request Modified


Modules Source Program

BIND COMPILE Listing

Application Plan Object Program

DB2 Catalog LINK-EDIT

Load Module

You might also like