Download - CICS by Pai
![Page 1: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/1.jpg)
Version 2.1
![Page 2: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/2.jpg)
Day-wise Schedule• Day 1
•Introduction To CICS
•System Components
•Data Communication Operation in CICS
•Characteristics of CICS
•Command Level Programming
•CICS COPY BOOKS
• Day 2
•BMS Programming Considerations
•Exceptional Conditions
•Terminal Control Operations
![Page 3: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/3.jpg)
Day-wise Schedule• Day 3
•Interval Control Operations
•Program Control Operations
•File Control Operations
• Day 4
•Advanced File Control Operations
•Temporary Storage Control
•CICS transactions
• Day 5
•CICS transactions continued
•Assignment Completion
![Page 4: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/4.jpg)
Introduction To CICSFeature Batch On-Line
Data Collection Off-Line On-Line
Input Sequential In Batch Random
Job Schedule At specific intervals Instantaneous
Resources Not Sharable Sharable
Response Time Not Critical Critical
Output In Printed Format On the Terminal
Security Simple Complex
Recovery Simple Complex
Information Not always current Always current
Updation In Batch Immediate
![Page 5: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/5.jpg)
Introduction To CICS
• Interactive Programs
•Data Entry Program
•Inquiry Program
•File Maintenance Program
•Menu Program
• Interactive System Considerations
•Shared Files
•Response Time
•Security
•Recovery
![Page 6: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/6.jpg)
Introduction To CICS• CICS acts as an interface between the Operating system and application
programs
ApplicationProgram
CICS
Op. System
![Page 7: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/7.jpg)
Introduction To CICS
• CICS System Concept
Data-Communication Functions
•Data Handling Functions
•Application Program Services
•System Services
•Monitoring Functions
![Page 8: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/8.jpg)
Operating System (MVS/XA)
Database Data Access Telecommunication Access Method Method Access Method (DL/I, DB2) (VSAM, (VTAM, TCAM,
Data Storage BDAM) BTAM)
CICS/MVS Terminals
System Services
Data-handling Monitoring Data-Comm.Functions Functions Functions
Application
Program Services
CICS Application programs (COBOL, PL/I, Assembler)
Other Systems
![Page 9: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/9.jpg)
Introduction To CICS
• Features Of CICS
•DB/DC
•Multiprogramming
•Multitasking
•Scheduling
![Page 10: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/10.jpg)
System Components
• Management Modules
• Tables
• Control Blocks
![Page 11: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/11.jpg)
System Components
• Management Modules
•Are the CICS/MVS program that interface between the operating
system and the application program.
•Each management module performs a particular function.
• Tables
•Defines the CICS/MVS system’s environment.
•The tables are functionally associated with the management modules.
![Page 12: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/12.jpg)
System Components
• Control Blocks
•Contain system type information
![Page 13: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/13.jpg)
Management Modules
TerminalControl Basic
MappingSupport
ProgramControl
TaskControl
IntervalControl
TransientData
ControlTemporaryStorageControl
JournalControl
StorageControl
DumpControl
TraceControl
FileControl
Nucleus
![Page 14: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/14.jpg)
Management Modules
• Terminal Control program Management Module (TCP)
•TCP is CICS interface to telecommunication access methods
(VTAM/TCAM)
•Transfers data between the application program and the terminal
•Handles hardware communication requirement
•Requests initiation of the new tasks
•BMS is an interface between application program and Terminal Control
program management module.
![Page 15: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/15.jpg)
Management Modules• Task control Program Management Module (KCP)
•Creates a task for the transaction requested
•Checks the validity of the transaction-id and the authority of the
operator.
•Allocates processor time among the tasks
•Keeps control of the status of all CICS tasks being processed
concurrently
•Transaction request can be made either
•By entering transaction Id at the terminal
•By another CICS transaction
![Page 16: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/16.jpg)
Management Modules• Program Control Program Management Module (PCP)
•Manages the flow of control within task
•Responsible for locating application program and if necessary load
them into storage for execution.
•Also responsible for transferring control to the program and
returning control back to CICS
•Uses PCT and PPT table to perform its actions.
•PCP knows if there are any tasks currently using the same program,
from the value of USE COUNTER in PPT.
•If USE COUNTER is zero, the storage is made available for other
purpose.
![Page 17: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/17.jpg)
Management Modules
• File Control program Management Module (FCP)
•Manages file processing activities of each application program
•FCP makes use of a table called File Control Table (FCT)
•FCT includes an entry for each file that is to be used during the
operation of CICS.
•Thereby freeing application programmer from defining the physical
organization and other file attributes.
•Provides exclusive control during the updation of a record by a task
![Page 18: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/18.jpg)
Management Modules
• Storage Control Program Management Module (SCP)
•Maintains full control over the virtual storage
•Acquires, controls and releases dynamic storage during execution
of a task
•Allocation of main storage is automatic
•Controls requests for the main storage
![Page 19: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/19.jpg)
Tables
• The tables define the resources that CICS controls
• Each table is associated with corresponding management modules
• The tables are brought into storage when CICS is initialized.
• For example, Terminal control table defines the terminals in the network.
File control table describes the data files the CICS program access.
![Page 20: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/20.jpg)
Tables
• Some of the important tables in CICS/MVS are:
•FCT: File Control Table
•PCT: Program Control Table
•PPT: Processing Program Table
•TCT: Terminal Control Table
•DCT: Destination Control Table
•SIT: System Initialization Table
![Page 21: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/21.jpg)
Control Blocks
• Dynamically created by CICS when needed
• Accessed by CICS modules during execution of tasks
• Released when no longer needed
• Example: Execute Interface Block (EIB), Task Control Area
![Page 22: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/22.jpg)
Data Communication Operation In CICS
• Terminal Control Program Management Module (TCP)
• Basic Mapping Support (BMS)
• Batch Data Interchange (BDI)
![Page 23: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/23.jpg)
Data Communication Operation In CICS
• Terminal Control Program Management Module (TCP)
•Is the basic method for communicating with devices
•BMS and BDI use terminal control facilities when invoked by an
application program
• Basic Mapping Support (BMS)
•Interface between TCP and application program
•Provides commands and options that can be used to format data in a
standard manner
•It converts data streams provided by the application program to conform
to the requirements of devices.
•Facilitates development of device & format independent programs
![Page 24: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/24.jpg)
Basic Mapping Support
• BMS removes the responsibility of formatting the screen from the
application program.
• BMS places the data with necessary control characters in a TIOA.
• It allows repositioning of fields without modifying application program
• BMS makes the application program Format Independent and Device
Independent
![Page 25: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/25.jpg)
Basic Mapping Support
• Format Independence
•Application programs are written without concern for physical
position of data fields within a display
•In an application program symbolic labels are used to refer the
fields
•BMS relates the label to the actual position in the display
![Page 26: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/26.jpg)
Basic Mapping Support
• Device Independence
•Application programs can be developed without any concern
for physical characteristics of the terminals
•BMS prepares the message based on the terminal type being
used
![Page 27: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/27.jpg)
BMS Maps
• A Screen defined through BMS is called a “map”.
• A “mapset” contains a single or multiple maps defined for one
terminal type.
• Two ways of defining maps
•CICS supplied macros
•Screen Definition Facility (SDF)
• Map represents BMS coding for a screen, and Mapset represents a
load module
![Page 28: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/28.jpg)
Map Generation
Design Screen
Code Map
Assemble
Symbolic MapPhysical Map
-Load Library-Contains Literals
-Source Library-Contains Data-fields
![Page 29: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/29.jpg)
Physical Map
• Describes display format for a given terminal type
• It includes
•The format of input & output data
•The fixed data such as page headings
•Symbolic names of variable data-fields
•The device type to which map relates.
• Physical Map Generation
BMS macro coding Assembly Link-edit
Load Module LOADLIB To be used by CICS
![Page 30: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/30.jpg)
Symbolic Map• Defines all variable data fields
• Ensures device and format independence
• Used by application program which issues a COBOL COPY statement in order to
include a symbolic map in the program.
• Symbolic Map Generation:
BMS macro coding Assembly Symbolic map definition
COPYLIB Copied into CICS application program
![Page 31: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/31.jpg)
Map and Mapset
• Map
•A representation of one screen format is called a map
•One or group of maps makes up a mapset
• Mapset
•A group of maps, which are linkedited together is called mapset
•Each mapset must be registered in PPT
![Page 32: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/32.jpg)
Map and Mapset
• Mapset
•The mapset name consists of two parts as follows:
•Generic Name: 1 to 7 characters
•Suffix : 1 character
•Application program uses only the generic name. The suffix is required at
the mapset definition time in order to distinguish the device types if the
same mapset is used for different types of terminals.
•CICS automatically inserts the suffix depending on the terminal in use,
thereby ensuring the device independence to the application program
![Page 33: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/33.jpg)
Components Of A Screen
• CICS identifies screen into three components:
•Mapset
•Maps
•Physical Map
•Symbolic Map
•Fields
•Unnamed (Literals)
•Named (Data fields)
•Stopper
![Page 34: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/34.jpg)
Attribute Byte Format
• The attribute character is always the first character of a
field.
• It occupies a character position on the screen but appears as
a blank
0 1 2 3 4 5 6 7
ProtectionIntensity MDT
Attribute Byte Bit Position :`
![Page 35: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/35.jpg)
Positions Functions Bit Settings
0-1 Information about bits 2 thru 7 2-3 protection 00 = Unprotected alphanumeric 01 = Unprotected numeric 10 = Protected 11 = skip 4-5 Intensity 00 = Normal 01 = Normal 10 = Bright 11 = No-display 6 Must be 0 7 MDT 0 = Field has not been modified 1 = Field has been modified
Attribute Byte Format
![Page 36: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/36.jpg)
Attribute Byte Format
• Field Protection
•Unprotected
•Protected
•Auto-skip
• Field Intensity
•Normal
•Bright
•No-display
• Shift
![Page 37: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/37.jpg)
Modified Data Tag (MDT)
• MDT is the one bit of the attribute character
• If it is zero, it indicates that this field has not been modified by the terminal
operator
If it is one, it indicates that this field has been modified by the operator.
• Only when it is ON, will data of the field be sent by the terminal to the
application program.
• Effective use of MDT reduces the data traffic in the communication line,
thereby improving performance significantly
![Page 38: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/38.jpg)
Modified Data Tag (MDT)
• Following are the three ways to set MDT ON:
•By data-entry
•By setting attribute byte in the physical map
•By moving MDT attribute in the application program
![Page 39: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/39.jpg)
Map Definition Macros
• Available Macros
•DFHMSD
•DFHMDI
•DFHMDF
• General Format
Col1 Col 10 Col16 Col17 Col72
Symbolic Opcode Parameter(s) Cont’d
Name Additional parametersChar.
![Page 40: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/40.jpg)
Map Definition Macros
• Example
1 10 16 17 72
MENU DFHMSD TYPE=&SYSPARM X
MODE=INOUT,
LANG=COBOL…..
![Page 41: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/41.jpg)
Map Definition Macros• Order of Map-Code PRINT NOGEN ----> Assembler Command
Label DFHMSD ----> Mapset Definition
Label DFHMDI ----> Map DefinitionDFHMDF ----> Field Definition
Label DFHMDF ----> Field DefinitionMap1 | | |
DFHMDF
Map2 DFHMDI DFHMDF | | DFHMDF
DFHMSD Type = Final --> Mapset Definition END -------------------> Assembler command
![Page 42: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/42.jpg)
DFHMSD Macro• Function
•The DFHMSD macro is used to define a mapset and its characteristics or to end a mapset definition. •Only one mapset definition is allowed within one assembly run.
• FormatLabel DFHMSD TYPE=DESECT|MAP|&SYSPARM|FINAL
[,MODE=IN|OUT|INOUT] [,LANG=ASM|COBOL|PLI] [,STORAGE=AUTO|BASE=name] [,CTRL=(FREEKB, ALARM, FRSET)] [,HIGHLIGHT=OFF|BLINK|REVERSE|UNDERLINE] [,VALIDN=MUSTFILL|MUSTENTER] [,TERM=TYPE|SUFFIX=n] [,TIOAPFX=YES|NO] [,DATA=FIELD|BLOCK]
![Page 43: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/43.jpg)
DFHMSD Macro
• End of Mapset Definition
DFHMSD TYPE=FINAL
![Page 44: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/44.jpg)
DFHMDI Macro• Function
•The DFHMDI macro is used to define a map and its characteristics in a mapset.
Label DFHMDI [SIZE=(LINE , COLUMN)]
[, LINE=number | NEXT | SAME]
[, COLUMN=ASM | COBOL | PLI ]
[, STORAGE=AUTO | BASE=name]
[, CTRL=([FREEKB] [, ALARM] [, FRSET])]
[, HIGHLIGHT=OFF | BLINK | REVERSE | UNDERLINE]
[, VALIDN=MUSTFILL | MUSTENTER]
[, TERM=TYPE | , SUFFIX=n]
[, TIOAPFX=YES | NO]
[, DATA=FIELD | BLOCK]
![Page 45: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/45.jpg)
DFHMDF Macro• Function
•The DFHMDF macro is used to define a field in map and its characteristics. The DFHMDF macro
can be issued as many times as you wish within one DFHMDI macro.
Label DFHMDF POS=(line | column)
[, LENGTH=number]
[, JUSTIFY=([LEFT | RIGHT])
[, ATTRB=(ASKIP | PROT | UPROT [, NUM]]
[, BRT | NORM | DRK]
[, IC][, FSET]) ]
[, HILIGHT=OFF | BLINK | REVERSE | UNDERLINE]
[, VALIDN=([MUSTFILL | MUSTENTER])
[, OCCURS=number]
[, INITIAL=’value’]
[, PICIN=’value’][, PICOUT=’value’]
![Page 46: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/46.jpg)
Format Of Symbolic Map
• A COBOL program must contain a COBOL COPY statement for each symbolic
map definition in working storage section.
• It starts with the 01 level definition of FILLER PC X(12), which is the TIOA
prefix created by TIOPFX=YES of the DFHMSD macro.
• Each symbolic map field consists of sub-fields. Each sub-field has a different
suffix.
![Page 47: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/47.jpg)
Format Of Symbolic Map
• nameL: Indicates length of the data entered in the field.
• nameF: It sets to ON when field gets modified
• nameA: The attribute byte for input/output field
• nameI: The input data field.
• nameO: The output data field.
• Example
![Page 48: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/48.jpg)
Characteristics Of CICS
• Multithreading
• Quasi-Reentrancy
• Pseudo-Conversational Programming
• Transaction Driven
![Page 49: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/49.jpg)
Quasi-Reentrant Program
VirtualStorage
Program AObject Code
Program AWorkingStorage(User1)
Program AWorkingStorage(User2)
User 1Running Program A
User 2RunningProgram A
![Page 50: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/50.jpg)
Command Level Programming
• CICS Program Development
•Macro Level Programming
•Command Level Programming
![Page 51: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/51.jpg)
CICS Command Format• CICS commands are embedded into the Host language, e.g. in the
Procedure Division of COBOL program.
• CICS commands in a COBOL program are delimited by•EXEC CICS………………END-EXEC.
• EXEC CICS is coded in margin B of COBOL program.
• The command level translator replaces these statements by COBOL
“MOVE” statements followed by COBOL “CALL” statement.
• The translated module is compiled & linked to produce an executable
load module.
• The translator also includes copy books into program.
![Page 52: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/52.jpg)
CICS Command Format
EXEC CICS Function
[option(argument)
option(argument)
--------
--------
]
END-EXEC.
![Page 53: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/53.jpg)
Command Language Translator
COBOL SourceProgram
Translator
Translated SourceProgram
COBOL Compiler
Object Module Link Edit Load Module
![Page 54: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/54.jpg)
COBOL/CICS Program StructureIDENTIFICATION DIVISION.PROGRAM-ID.ENVIRONMENT DIVISION.DATA DIVISION.WORKING-STORAGE SECTION.Variable declarationFile layoutSymbolic mapCopy booksDFHEIVARLINKAGE SECTION.DFHCOMMAREAEIBBLOCKBLL CELLSPROCEDURE DIVISION.
![Page 55: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/55.jpg)
COBOL/CICS Program Structure
• The following COBOL statements are prohibited in a CICS application
program:
•ACCEPT, CURRENT-DATE, DATE DAY, DISPLAY, EXHIBIT,
STOP RUN, TRACE
•Any I/O statements (OPEN, CLOSE, READ, WRITE, REWRITE,
DELETE, START
•REPORT WRITER Feature
•SORT Feature
![Page 56: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/56.jpg)
Passing the data using COMMAREA• Passing of data from one program to another is achieved by COMMAREA
defined in working-storage section.
• The receiving program will receive the data in its linkage section, under
DFHCOMMAREA.
• May be used in functions like RETURN/XCTL/LINK
• The length of COMMAREA must be specified in the LENGTH parameter of
the LINK or XCTL command in the calling program.
• The LENGTH parameter must be defined as a half-word binary fields (S9(04)
COMP).
• Called program can find length of data passed using the EIB field EIBCALEN
![Page 57: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/57.jpg)
Passing the data using COMMAREA
• If no data is passed then EIBCALEN is equal to zero
• If data is passed then EIBCALEN is equal to length of COMMAREA
IDENTIFICATION DIVISION.ENVIRONMENT DIVISION.DATA DIVISION.WORKING-STORAGE SECTION.01 WS-COMM-AREA.-------LINKAGE SECTION.01 DFHCOMMAREA.--------PROCEDURE DIVISION
IDENTIFICATION DIVISION.ENVIRONMENT DIVISION.DATA DIVISION.WORKING-STORAGE SECTION.01 WS-COMM-AREA.-------LINKAGE SECTION.01 DFHCOMMAREA.--------PROCEDURE DIVISION
Temp.StorageArea
Previous Execution Current Execution
![Page 58: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/58.jpg)
CICS COPY BOOKS
• Exec Interface Block (EIB) In Linkage Section
•Keeps record of system related information.
•One EIB is created per task.
•EIB for a task contains information about the task, which is initiated.
•Copy of DFHEIBLK as EIB is automatically included in linkage section
of application program during translation.
•Program can only access data using EIB field names.
•User should not update data in EIB fields.
![Page 59: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/59.jpg)
CICS COPY BOOKS•Some of the EIB fields are EIBAID
•EIBCALEN
•EIBCPOSN
•EIBDATE
•EIBTIME
•EIBDS
•EIBRCODE
•EIBREQID
•EIBRESP
•EIBTRMID
•EIBTRNID
•EIBTASKN
![Page 60: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/60.jpg)
CICS COPY BOOKS• Standard Attribute Byte List
•DFHBMSCAConstants Meaning DFHBMPEM Printer end-of-messageDFHBMPNL Printer new lineDFHBMASK Auto-SkipDFHBMUNP UnprotectedDFHBMUNN Unprotected & numDFHBMPRO ProtectedDFHBMPRY BrightDFHBMDAR DarkDFHBMFSE MDT setDFHBMPRF Protected and MDT setDFHBMASF Auto-Skip & MDT setDFHBMASB Auto-Skip & bright
![Page 61: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/61.jpg)
CICS COPY BOOKS•Installation Defined01 Field-Attribute-Definition. 05 FAC-UNPROT PIC X VALUE ' '. 05 FAC-UNPROT-MDT PIC X VALUE 'A'. 05 FAC-UNPROT-BRT PIC X VALUE 'H'. 05 FAC-UNPROT-BRT-MDT PIC X VALUE 'I'. 05 FAC-UNPROT-DARK PIC X VALUE '<'. 05 FAC-UNPROT-DARK-MDT PIC X VALUE '('. 05 FAC-UNPROT-NUM PIC X VALUE '&'. 05 FAC-UNPROT-NUM-MDT PIC X VALUE 'J'. 05 FAC-UNPROT-NUM-BRT PIC X VALUE 'Q'. 05 FAC-UNPROT-NUM-BRT-MDT PIC X VALUE 'R'. 05 FAC-UNPROT-NUM-DARK PIC X VALUE '*'. 05 FAC-UNPROT-NUM-DARK-MDT PIC X VALUE ')'. 05 FAC-PROT PIC X VALUE '-'. 05 FAC-PROT-MDT PIC X VALUE '/'. 05 FAC-PROT-BRT PIC X VALUE 'Y'. 05 FAC-PROT-BRT-MDT PIC X VALUE 'Z'. 05 FAC-PROT-DARK PIC X VALUE '%'. 05 FAC-PROT-DARK-MDT PIC X VALUE '_'. 05 FAC-PROT-SKIP PIC X VALUE '0'. 05 FAC-PROT-SKIP-MDT PIC X VALUE '5'. 05 FAC-PROT-SKIP-BRT PIC X VALUE '8'. 05 FAC-PROT-SKIP-BRT-MDT PIC X VALUE '9'. 05 FAC-PROT-SKIP-DARK PIC X VALUE '@'. 05 FAC-PROT-SKIP-DARK-MDT PIC X VALUE QUOTE.
![Page 62: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/62.jpg)
CICS COPY BOOKS• Installation Defined Message File
• 01 WS-MESSAGES.
05 WS-FATAL-ERROR-MSG PIC X(30) VALUE 'YOU CAN ONLY START
FROM MENU'.
05 WS-NORMAL-EXIT-MSG PIC X(30) VALUE 'SESSION ENDS HAVE A
NICE DAY'.
05 WS-INVALID-KEY-MSG PIC X(30) VALUE 'INVALID AID KEY
PRESSED'.
05 WS-NOT-UNIQUE-MSG PIC X(30) VALUE 'ISSUE NOTE NO EXISTING'.
05 WS-ITEM-NOT-FND-MSG PIC X(30) VALUE 'ITEM NOT FOUND'.
05 WS-INVALID-QTY-MSG PIC X(30) VALUE 'INVALID QUANTITY ENTERED'.
05 WS-DUP-REC-MSG PIC X(30) VALUE 'DUPLICATE RECORD'.
![Page 63: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/63.jpg)
CICS COPY BOOKS
• Attention Identifier (AID)
•Attention Identifier indicates which method the terminal operator has used
to initiate the transfer of information from the terminal device to CICS
•AID keys are: PF keys, PA keys, ENTER key, and CLEAR key.
•The EIBAID field in EIB contains the AID code of the most recently used
AID.
•CICS provides the standard AID list in a form of copy library
member(DFHAID), so that a program can use this list by specifying in the
program: COPY DFHAID
![Page 64: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/64.jpg)
CICS COPY BOOKS
•The DFHAID member contains such AID codes as:
•DFHENTER: ENTER key•DFHCLEAR: CLEAR key•DFHPA1-3: PA1 TO PA3 keys•DFHPF1-24: PF1 TO PF24 keys
•Example
IF EIBAID = DFHPF3 PERFORM 2100-END-ROUTINEELSE IF EIBAID = DFHPA1 PERFORM 2200-CANCEL-ROUTINEELSE IF EIBAID = DFHENTER PERFORM 2300-NORMAL-ROUTINE ELSE PERFORM 2400-WRONG-ROUTINE.
![Page 65: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/65.jpg)
Application Program Housekeeping
• Exceptional Conditions
•An abnormal situation during execution of a CICS command is called an
“exceptional condition”.
• Exceptional conditions can be handled using any of the following:
•HANDLE CONDITION command
•IGNORE CONDITION command
•NOHANDLE option
![Page 66: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/66.jpg)
HANDLE CONDITION Command
EXEC CICS HANDLE CONDITIONcondition(label)[condition(label)….][ERROR(label)]
END-EXEC.
• The “condition” represents an exceptional condition. If a “label” is specified, control will be passed to the labeled paragraph when the condition specified occurs.
• If no label is specified, it has the effect of canceling the previously set HANDLE CONDITION request and the default action will be taken.
![Page 67: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/67.jpg)
HANDLE CONDITION Command
• The general error condition (ERROR) can be specified within the same
list to specify that all other conditions cause control to be passed to the
label specified.
• Not more than 16 conditions can be specified in a single HANDLE
CONDITION command.
• You can specify more than one HANDLE CONDITION command in
the program.
![Page 68: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/68.jpg)
HANDLE CONDITION CommandExample:
2110-RECEIVE-CHOICE SECTION. EXEC CICS HANDLE CONDITION MAPFAIL(2110-MAP-FAIL) END-EXEC. EXEC CICS RECEIVE MAPSET('MENUMAP') MAP('MENUMAP') INTO(MENUMAPI) END-EXEC. GO TO 2110-EXIT.
2110-MAP-FAIL. MOVE 'MAP FAIL SESSION ENDED' TO WS-END-SESSION-MESSAGE. MOVE 'Y' TO WS-END-SESSION. 2110-EXIT. EXIT.
![Page 69: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/69.jpg)
IGNORE CONDITION Command
• Causes no action to be taken if the condition specified occurs in the program.
• Control will returned to the next instruction following the command, which encountered the exceptional condition.
• The request by the IGNORE CONDITION command is valid until the subsequent HANDLE CONDITION command for the same condition.
• Format
EXEC CICS IGNORE CONDITION condition
[condition]END-EXEC.
![Page 70: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/70.jpg)
IGNORE CONDITION Command• Example
EXEC CICS IGNORE CONDITION
LENGERR
END-EXEC.
EXEC CICS RECEIVE MAP(‘MAP1’)
MAPSET(‘MAP1’)
INTO(MAP1I)
LENGTH(80)
END-EXEC.
![Page 71: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/71.jpg)
NOHANDLE Option• This option can be specified in any CICS command, and it will cause no action to be
taken for any exceptional condition occurring during execution of this command
• Example
• EXEC CICS SEND
MAP(----)
MAPSET(------)
FROM(------)
LENGTH(---)
NOHANDLE
END-EXEC.
![Page 72: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/72.jpg)
NOHANDLE Option
• RESP option
•If RESP option is specified in a command, CICS places a response code at
a completion of the command
•The application program can check this code, then proceed to the next
processing.
•If the RESP option is specified in a command, the NOHANDLE option is
applied to this command. Therefore, the HANDLE CONDITION requests
will have no effect in this case.
![Page 73: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/73.jpg)
NOHANDLE Option• Example:
EXEC CICS RECEIVE MAP(----) MAPSET(------) INTO(------) LENGTH(---) NOHANDLE
RESP(WS-RESP-FIELD) END-EXEC. IF WS-RESP-FIELD = DFHRESP(NORMAL)
----------- ELSE IF WS-RESP-FIELD = DFHRESP(MAPFAIL) -----------
![Page 74: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/74.jpg)
HANDLE AID Command• This command is used to specify the label to which control is to be passed
when the specified AID is received.
• This is one way of substituting the EIBAID checking approach.
• AID keys are PA keys, PF keys, ENTER and CLEAR key.
• CLEAR and any of the PA keys do not transmit data.
• Format:
EXEC CICS HANDLE AID
Option(label)
END-EXEC.
![Page 75: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/75.jpg)
HANDLE AID Command• Commonly used Options
•Any key name (PA1 to PA3, PF1 to PF24, ENTER, CLEAR•ANYKEY (Any of the above except ENTER key)
• Example:
EXEC CICS HANDLE AID PF3(2100-END-ROUTINE) PA1(2100-CANCEL-ROUTINE) ENTER(2100-NORMAL-ROUTINE) ANYKEY(2100-WRONG-KEY-ROUTINE)
END-EXEC. EXEC CICS RECEIVE MAP(‘MAP1’)
MAPSET(‘MAP1’) INTO (MAP1I) LENGTH(WS-MAP-LENGTH)
END-EXEC.
![Page 76: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/76.jpg)
Disadvantage of Using HANDLE AID Command
![Page 77: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/77.jpg)
EIBAID
• The 3270 terminal transmits the AID character to the EIBAID field of EIBAID field of EIB, at the time of task initiation.
• EIBAID can be used to find which AID key has been pressed by user• CICS copy book DFHAID fields are used to identify the key pressed
IF EIBAID = DFHAID(ENTER)
OR
IF EIBAID = DFHENTER
• EIBAID value can be checked even without receiving map.
![Page 78: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/78.jpg)
BMS Programming Considerations
• Dynamic attribute Character Assignment
• Cursor Positioning Techniques
![Page 79: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/79.jpg)
Dynamic Attribute Character Assignment
• “COPY DFHBMSCA” in Working Storage section of the application program.
• You can assign a default attribute character in a BMS map.
• For a dynamic attribute character assignment you place the predefined attribute character to the fieldname+A of the field to which you wish to dynamically assign the attribute character.
• When the map is sent through SEND MAP command, the new attribute will be in effect on the field on subject, overriding the original attribute defined at the map definition time.
![Page 80: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/80.jpg)
Dynamic Attribute Character Assignment• Example
WORKING-STORAGE SECTION.-------
COPY 'MAPSETA'. -------
COPY 'DFHBMSCA'. -------
PROCEDURE DIVISION. ------- MOVE DFHBMBRY TO CUSTNO-A. MOVE DFHDMPRO TO CUSTNAME-A. MOVE DFHDMPRO TO AMOUNT-A. EXEC CICS SEND
MAP ('MAPNAME') MAPSET('MAPSETA')
FROM(MAPSETAI) END-EXEC.
![Page 81: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/81.jpg)
Cursor Positioning Techniques
• Static Cursor Positioning
• Dynamic/Symbolic Cursor Positioning
• Relative Cursor Positioning
![Page 82: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/82.jpg)
Cursor Positioning Techniques
• Static Cursor Positioning
•In this approach, you define a cursor position in a map by placing “IC”
in the ATTRB parameter of the DFHMDF macro for a particular field.
•When the map is sent, the cursor will appear in this field
•If there are more than one field with IC specified in one map, the last IC
would be honored.
•Example:
DFHMDF POS=(3,16),
ATTRB=(UNPROT, FSET, IC) LENGTH=8
![Page 83: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/83.jpg)
Cursor Positioning Techniques• Symbolic Cursor Positioning
• In this approach, you dynamically position a cursor through an application program using a symbolic name of the symbolic map by placing –1 into the field’s length field (i.e., filename+L) of the field where you wish to place the cursor.
• The SEND MAP command to be issued must have the CURSOR option (without argument).
• Example MOVE –1 TO CHOICEL. EXEC CICS SEND MAP(‘MAP1’)
MAPSET(‘MAP1’) CURSOR ERASE
END-EXEC.
![Page 84: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/84.jpg)
Cursor Positioning Techniques
• Relative Cursor Positioning•In this approach, you dynamically position a cursor through an application program using the CURSOR(data-value) option in the SEND MAP command.•The map will be displayed with the cursor at the specified position, overriding the static cursor position defined at the map definition time•Data-value is calculated as: (row-1) * 80 + (column –1)•ExampleEXEC CICS SEND
MAP(------) MAPSET(-------) CURSOR(100) ERASE
END-EXEC.
![Page 85: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/85.jpg)
Terminal Control Operations
• RECEIVE MAP: Formatted data transfer. To receive a map.
• SEND MAP: Formatted data transfer. To send a map.
• RECEIVE: Unformatted data transfer. To receive a text.
• SEND TEXT: Unformatted data transfer. To send a text.
![Page 86: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/86.jpg)
RECEIVE MAP Command (Formatted Data Transfer)
• Function
•This command is used to receive a map from a terminal.
•At the completion of the command, the symbolic map of the specified
map will contain the data from the terminal in the following fields per
each field defined by the DFHMDF macro.
•Fieldname+L
•Fieldname+F
•Fieldname+I
![Page 87: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/87.jpg)
RECEIVE MAP Command (Formatted Data Transfer)
• Format
EXEC CICS RECEIVE MAP(map name)
[MAPSET(mapset name)]
[INTO(data-area)]
END-EXEC.
![Page 88: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/88.jpg)
RECEIVE MAP Command (Formatted Data Transfer)• Common Exceptional Conditions
•MAPFAIL
•If the data to be mapped has the length of zero.
•If user presses the ENTER without typing data.
•If map is received by pressing CLEAR or any of the PA keys.
![Page 89: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/89.jpg)
SEND MAP Command (Formatted Data Transfer)
• Function
•This command is used to send a map to a terminal.
•Before issuing this command, the application program must prepare
the data in the symbolic map of the map to be sent, which has
following fields per each field defined by the DFHMDF macro.
•Fieldname+L
•Fieldname+A
•Fieldname+O
![Page 90: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/90.jpg)
SEND MAP Command (Formatted Data Transfer)
• Format
EXEC CICS SEND MAP(map name)
MAPSET(mapset name)
[FROM(data-area)]
[CURSOR/CURSOR(data-value)]
[ERASE/ERASEAUP]
[FREEKB] [ALARM]
[FRSET]
[DATAONLY | MAPONLY]
END-EXEC.
![Page 91: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/91.jpg)
SEND MAP Command (Formatted Data Transfer)
• Example
WORKING-STORAGE SECTION.---------------COPY MAPA.--------------PROCEDURE DIVISION.--------------
EXEC CICS HANDLE CONDITION INVMPSZ(BIG-MAP)
END-EXEC.---------------
EXEC CICS SEND MAP MAP(‘MAPA’) MAPSET(‘MAPA’)
FROM(MAPAI)END-EXEC.
BIG-MAP. ERROR PROCESSING……………
![Page 92: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/92.jpg)
RECEIVE Command (Unformatted Data Transfer)• Function
•This command is used to receive an unformatted message from the terminal.
•In this data transfer maps are not involved.
• Format
EXEC CICS RECEIVE INTO(data-area)
LENGTH(data-value)
END-EXEC.
![Page 93: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/93.jpg)
SEND TEXT Command (Unformatted Data Transfer)• Function
•This command is used to send unformatted message
•This message will always get displayed at row 1, column 1 position on the
screen.
• Format
EXEC CICS SEND TEXT FROM(data-area)
LENGTH(data-value)
[ERASE]
[FREEKB]
END-EXEC.
![Page 94: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/94.jpg)
Interval Control Operations
• ASKTIME Command
• FORMATTIME Command
![Page 95: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/95.jpg)
ASKTIME Command
• Function
•This command is used to request the current date and time.
•Also updates the EIBDATE and EIBTIME fields.
• Format
EXEC CICS ASKTIME
[ABSTIME(data-area)]
END-EXEC.
![Page 96: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/96.jpg)
FORMATTIME Command• Function
•This command is used to receive the information of date and time in various formats.• Format
EXEC CICS FORMATTIME ABSTIME(data-area)[YYDDD(data-area)][YYMMDD(data-area)][YYDDMM(data-area)][MMDDYY(data-area)][DDMMYY(data-area)][DATESEP(data-value)][DAYOFWEEK(data-area)][DAYOFMONTH(data-area)][MONTHOFYEAR(data-area)][YEAR(data-area)][TIME(data-area)[TIMESEP(data-value)]]
END-EXEC.
![Page 97: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/97.jpg)
Program Control Operations
• RETURN: To return to the next higher-level program or CICS.
• LINK: To pass control to another program at lower level.
• XCTL: Tp pass control to another program at the same level.
• LOAD: To load a program.
• RELEASE: To release a loaded program.
![Page 98: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/98.jpg)
RETURN Command
• Format
EXEC CICS RETURN
[TRANSID(name)
[COMMAREA(data-area)
[LENGTH(data-value)]]]
END-EXEC.
![Page 99: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/99.jpg)
LINK and XCTL Command
• Function of LINK Command•It is used to pass control from an application program at one logical level to another application at the next lower logical level.•The calling program expects control to returned to it.•The control is returned at the next sentence when called program completes execution.
Program A LINK
Program B Higher Logical Level RETURN
Lower Logical Level
![Page 100: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/100.jpg)
LINK and XCTL Command
• Format Of LINK Command
EXEC CICS LINK
PROGRAM(name)
[COMMAREA(data-area)]
[LENGTH(data-value)]
END-EXEC.
![Page 101: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/101.jpg)
LINK and XCTL Command• Function of XCTL Command
•Used to pass control from one application program to another application
program at the same logical level.
• Format Of XCTL Command
EXEC CICS XCTL
PROGRAM(name)
[COMMAREA(data-area)]
[LENGTH(data-value)]
END-EXEC.
![Page 102: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/102.jpg)
LINK and XCTL Command
• Common Exceptional Conditions
•NOTAUTH
•PGMIDERR
![Page 103: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/103.jpg)
XCTL vs LINK
• Calling program is released
from the main memory
• Control is transferred to the
same logical level
• Return can be to CICS or to
the application program
• COMMAREA option can be
used to pass data to the
invoked program
• Calling program is not released from
the main memory
• Control is transferred tosame logical
level
• Return is always to the application
program
• COMMAREA option is not required
in RETURN because the invoked
program does pass pointer to the
communication area of the calling
program.
XCTL LINK
![Page 104: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/104.jpg)
File Control Operations (Random Access)
• Supported Access Methods
•CICS File Control supports the VSAM and BDAM data access
method under CICS.
•There are three types of VSAM file, all of which are supported by
CICS. These are as follows:
•Key-Sequenced Dataset (KSDS)
•Entry-Sequenced Dataset (ESDS)
•Relative-Record Dataset (RRDS)
![Page 105: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/105.jpg)
File Control Operations (Random Access)
• Available Commands
•READ: To read a record directly
•WRITE: To newly write a record
•REWRITE: To update an existing record
•DELETE: To delete a record
•UNLOCK: To release exclusive control acquired for update
![Page 106: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/106.jpg)
File Control Operations (Random Access)
• Special services of File Control Program
•Data Independence
•Exclusive control during updates
•File Open/Close
![Page 107: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/107.jpg)
READ Command Using Full Key
• Function
•The READ command with the INTO option using the full key
of a record is used to read a specific record by the full key.
•The data content of the record will be moved into the specified
field defined in the working-storage section of the program
![Page 108: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/108.jpg)
READ Command Using Full Key
• Format
EXEC CICS READ
DATASET(name)
INTO(data-area)
RIDFLD(data-area)
[LENGTH(data-value)]
END-EXEC.
![Page 109: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/109.jpg)
READ Command Using Full Key
• Common Exceptional conditions
•DUPKEY
•NOTFND
•LENGERR
•NOTOPEN
![Page 110: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/110.jpg)
READ Command Using GTEQ Option
• Function
•The READ command with the GTEQ option is used to read a nonspecific record whose key is
equal to or greater than the full key data specified
• Format/Example
MOVE 35 TO WK-LEN.
MOVE ‘NY003’ TO REC-KEY. =must be a full key
EXEC CICS READ
DATASET(‘FILE2’)
INTO(FILE-IOAREA)
RIDFLD(REC-A-KEY)
GTEQ LENGTH(WK-LEN)
END-EXEC.
![Page 111: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/111.jpg)
READ/UPDATE and REWRITE commands• Function
•A combination of the READ command with the UPDATE option and the REWRITE command is used to update a record.
• Format/Example
MOVE 35 TO WK-LEN.MOVE ‘NY001’ TO REC-A-KEY.EXEC CICS READ
DATASET(‘FILE2’)INTO(FILE-IOAREA)RIDFLD(REC-A-KEY)UPDATELENGTH(WK-LEN)
END-EXEC. =read for updating
Set of MOVE Statements………EXEC CICS REWRITE
DATASET(‘FILE2’)FROM(FILE-IOAREA)LENGTH(WK-LEN)
END-EXEC.
![Page 112: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/112.jpg)
UNLOCK Command
• The READ command with the UPDATE option normally maintains
exclusive control over the record read until:
•The record is updated by the REWRITE command.
•The transaction is normally or abnormally completed.
• Format/Example
EXEC CICS UNLOCK
DATASET(‘FILE2’)
END-EXEC.
![Page 113: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/113.jpg)
WRITE Command• Function
•This command is used to write a record directly into a file based on
the key specified.
• Format
EXEC CICS WRITE
DATASET(name)
FROM(data-area)
LENGTH(data-value)
RIDFLD(data-area)
END-EXEC.
![Page 114: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/114.jpg)
WRITE Command• Example
MOVE 35 TO WK-LEN.MOVE ‘NY004’ TO REC-A-KEY.Move symbolic map fields to the record area……EXEC CICS WRITE
DATASET(‘FILE2’) FROM(FILE-IOAREA) RIDFLD(REC-A-KEY) LENGTH(WK-LEN)
END-EXEC.
![Page 115: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/115.jpg)
WRITE Command
• Exceptional Conditions
•DUPREC
•NOSPACE
•LENGERR
![Page 116: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/116.jpg)
WRITE Command with MASSINSERT Option
• Function
•The WRITE command with the MASSINSERT option is used to add
a group of records whose keys are in ascending order into a file.
• Procedures
•Establish the first record key
•Issue the WRITE command with the MASSINSERT option.
•Increment the key the ascending order.
•Repeat steps 2 and 3 until all records have been written
•Issue the UNLOCK command to release the exclusive control over
the file.
![Page 117: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/117.jpg)
WRITE Command with MASSINSERT Option• Format/Example
PROCEDURE DIVISION……..MOVE ‘TX000’ TO REC-A-KEY’.MASS-INS-LOOP SECTION.
ADD 1 TO REC-A-KEY-SEQ.…….(Prepare the record content)…….EXEC CICS WRITE
DATASET(‘FILE2’) FROM(FILE-IOAREA) RIDFLD(REC-A-KEY) LENGTH(WK-LEN) MASSINSERT
END-EXEC. IF REC-A-SEQ < 99
GO TO MASS-INS-LOOP.EXEC CICS UNLOCK
DATASET(‘FILE2’) END-EXEC.
![Page 118: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/118.jpg)
DELETE Command• Function
•The DELETE command is used to delete one record or a group of
records from a file.
•There are three approaches to using the DELETE command
•DELETE after READ/UPDATE Approach
•Direct DELETE Approach
•Group Record DELETE Approach
![Page 119: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/119.jpg)
DELETE after READ/UPDATE Approach
• In this approach, the DELETE command is used without the record key
information, after the READ command with the UPDATE option has
been completed.
• The record which was read by the READ/UPDATE command will be
deleted from the file
![Page 120: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/120.jpg)
DELETE after READ/UPDATE Approach• Format/Example
MOVE 35 TO WK-LEN.MOVE ‘NY001’ TO REC-A-KEY.EXEC CICS READ
DATASET(‘FILE2’) INTO(FILE-IOAREA) RIDFLD(REC-A-KEY) UPDATE LENGTH(WK-LEN)
END-EXEC.……EXEC CICS DELETE
DATASET(‘FILE2’)END-EXEC.
![Page 121: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/121.jpg)
Direct DELETE Approach• In this approach, the DELETE command is issued with the full key
information in the RIDFLD field.
• The record specified will be directly deleted from the file.
• Format/Example
MOVE ‘NY001’ TO REC-KEY.EXEC CICS DELETE
DATASET (‘FILE2’) RIDFLD(REC-A-KEY) = required
END-EXEC.
![Page 122: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/122.jpg)
Group Record DELETE Approach• In this approach, DELETE command is issued with the GENERIC option.
• A group of records, which satisfy generic key specified, will be deleted from the file.
• Format/ExamplePROCEDURE DIVISION.…..MOVE ‘NY’ TO RE-A-KEY.EXEC CICS DELETE
DATASET(‘FILE2’) RIDFLD(‘REC-A-KEY’) KEYLENGTH(+2) GENERIC NUMREC(WK-DEL-COUNT)
END-EXEC.
![Page 123: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/123.jpg)
File Control Operations (Seq. Access)
• Under CICS any of the VSAM datasets can be accessed randomly as well as
sequemntially.
• Available Commands:
•STARTBR : To establish the position of the BROWSE operation
•READNEXT : To read a next record (Forward)
•READPREV : To read a previous record (backward)
•RESETBR : To reestablish another position for a new browse
•ENDBR : To complete a browse operation.
![Page 124: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/124.jpg)
STARTBR Command• Function
•This command is used to establish a browse starting position for a file.
• FormatEXEC CICS STARTBR
DATASET(name) RIDFLD(data-area) [GTEQ/EQUAL] [KEYLENGTH(data-area) GENERIC] [RBA/RRN]
END-EXEC
![Page 125: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/125.jpg)
STARTBR Command• Example
WORKING-STORAGE SECTION.01 WK-LEN PIC S9(4) COMP.01 FILE-IO-AREA. 05 REC-A-KEY. 10 REC-A-KEY-CITY PIC X(02).
10 REC-A-KEY-SE PIC 9(03). 05 REC-A-DETAIL PIC X(30).PROCEDURE DIVISION.:
MOVE ‘NY000’ TO RE-A-KEY.EXEC CICS STARTBR
DATASET (‘FILE2’) RIDFLD(REC-A-KEY) GTEQ = default
END-EXEC.
![Page 126: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/126.jpg)
STARTBR Command• Exceptional Conditions
•DSIDERR
•NOTFND
![Page 127: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/127.jpg)
READNEXT Command• Function
•The READNEXT command is used to read a record of a file sequentially
forward.
• Format
• EXEC CICS READNEXT
DATASET(name)
INTO(data-area)
[LENGTH(data-value)]
RIDFLD(data-area)
[RBA/RRN]
END-EXEC.
![Page 128: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/128.jpg)
READNEXT Command
• Exceptional Conditions
•DUPKEY
•ENDFILE
•LENGERR
![Page 129: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/129.jpg)
READPREV Command
• Function
•This command is used to read a record of a file backward.
• Format/Example
• Exceptional Conditions
•NOTFND
•INVREQ
![Page 130: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/130.jpg)
Skip Sequential Read
• This technique is used to skip records while continuing the browse
operation established by the prior STARTBR command
• For the READNEXT command, the new key for skipping must be in
the forward direction from the current record.
• Similarly, for the READPREV command, the new key for skipping
must be in the backward direction from the current record.
![Page 131: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/131.jpg)
Changing Direction of Browse
• After the STARTBR command, the direction of browse can be changed
from forward to backward by simply switching the READNEXT
command to the READPREV command, or vice versa.
• The first READPREV (or READNEXT) command after the direction
change will read the same record as th elast READNEXT (or
READPREV) command
![Page 132: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/132.jpg)
RESETBR Command
• Function
•This command is used to reestablish another starting point within the
same browse operation against the same file.
•Functionality wise same as STARTBR
•This command makes it possible to reposition the dataset for a new
browse operation. (without issuing ENDBR command)
![Page 133: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/133.jpg)
ENDBR Command
• Function
•At physical end of file or logical end of file, the browser
operation is terminated using this command.
• Format/Example
EXEC CICS ENDBR
DATASET(‘FILE2’)
END-EXEC.
![Page 134: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/134.jpg)
Multiple Browse Operations
• The multiple browse operations are used to perform several concurrent
browse operations against the same file.
• One browse operation is to be identified by the REDQID parameter in
the browse command.
![Page 135: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/135.jpg)
Temporary Storage Control
• The CICS Temporary Storage Control Program (TSP) provides
the application program with an ability to store and retrieve the
data in a Temporary Storage Queue (TSQ).
• Typically TSQ is used for passing of data among transactions.
• A Temporary Storage Queue is queue of stored records (data).
• It is created and deleted dynamically by an application program
without specifying in the CICS control tables, as long as data
recovery is not intended.
![Page 136: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/136.jpg)
Temporary Storage Control
• A TSQ is identified by the queue id (1 to 8 bytes), and the relative position number called item number identifies a record within a TSQ.
• The records in TSQ once written, remain accessible until the entire TSQ is explicitly deleted.
• The records in TSQ can be read sequentially or directly. Also records in TSQ can be updated.
• TSQ may be written in the main storage or the auxiliary storage in the DASD.
![Page 137: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/137.jpg)
TSQ in MAIN Storage or Auxiliary Storage• TSQ can be written in main storage.
• In this case, accessing TSQ is a fast and convenient operation.
• But TSQ in this mode are not recoverable.
• TSQ can also be written in auxiliary storage in a VSAM file (DFHTEMP)
established by the system programmer.
•It is always available to the application program, which implies that no file
open/close is required.
•TSQ in this mode is recoverable.
• In case of large quantity of data auxiliary storage is preferred.
![Page 138: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/138.jpg)
Temporary Storage Control
• Available Commands
•WRITEQ TS: To write or rewrite a record in a TSQ
•READQ TS: To read a record in a TSQ
•DELETEQ TS: To delete a TSQ
![Page 139: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/139.jpg)
WRITEQ TS Command (No Update)
• Function•This command is use to write a record (item) in a TSQ.
• Format/Example
EXEC CICS WRITEQ TSQUEUE(‘AttttM01’)FROM(TSQ-DATA)LENGTH(TSQ-LEN)ITEM(TSQ-ITEM)
MAINEND-EXEC.
![Page 140: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/140.jpg)
WRITEQ TS Command (No Update)
• Common Options
•NOSUSPEND
•AUXILIARY
• Exceptional Condition
•NOSPACE
![Page 141: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/141.jpg)
READQ TS Command (Direct Read)
• Function
•This command is used to read a particular record (item) of a particular
TSQ.
• Format/Example
EXEC CICS READQ TS
QUEUE(TSQ-QID)
INTO(TSQ-DATA)
LENGTH(TSQ-LEN)
ITEM(TSQ-ITEM)
END-EXEC.
![Page 142: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/142.jpg)
READQ TS Command (Direct Read)
• Commonly Used Options
•NUMITEMS
•NEXT
• Exceptional Condition
•QIDERR
•ITEMERR
![Page 143: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/143.jpg)
READQ TS Command (Sequential Read)
• Function
•The READQ TS command can be used also for reading all records
sequentially in the queue.
•But this reading should be performed based on the programming technique
s, instead of NEXT option of the READQ TS command
.
• Format/Example
![Page 144: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/144.jpg)
*ESTABLISH HANDLE CONDITION.EXEC CICS HANDLE CONDITION
ITEMERR(TSQ-EOF) ERROR(SQ-ERROR)
END-EXEC.LOOP.
ADD 1 TO TSQ-ITEM.MOVE 200 TO TSQ-LEN.
*READ A QUEUE.EXEC CICS READQ TS QUEUE(TSQ-QID)
INTO(TSQ-DATA) LENGTH(TSQ-LENGTH) ITEM(TSQ-ITEM)
END-EXEC.:
(PROCESS A RECORD):
GO TO LOOP.TSQ-EOF.
(EOF PROCESSING) :
READQ TS Command (Sequential Read)
![Page 145: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/145.jpg)
READQ TS Command (Sequential Read)
• Note:
•The sequential read of TSQ should be done By providing ITEM.
•This is a better approach than specifying the NEXT option in
the READQ TS command.
•If NEXT option is specified, and if other task have read several
records of the same TSQ after the last read by this task, then this
task would read a skipped record.
•Therefore NEXT option should be used very carefully.
![Page 146: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/146.jpg)
WRITEQ TS Command with REWRITE Option
• Function
•The WRITEQ TS command with REWRITE option is used to
rewrite a record of a TSQ, which has been read.
• Format/Example
![Page 147: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/147.jpg)
EXEC CICS READQ TS QUEUE(TSQ-QID) INTO(TSQ-DATA) LENGTH(TSQ-LEN) ITEM(TSQ-ITEM)
END-EXEC.:*Process data in TSQ-DATA:EXEC CICS WRITEQ TS
QUEUE(TSQ-QID)FROM(TSQ-DATA)LENGTH(TSQ-LEN)ITEM(TSQ-ITEM)REWRITEMAIN
END-EXEC.
WRITEQ TS Command with REWRITE Option
![Page 148: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/148.jpg)
DELETEQ TS Command• Function
•This command is used to delete a TSQ entirely
• Format/Example
EXEC CICS DELETEQ TS
QUEUE(TSQ-ID)
END-EXEC.
• Exceptional Condition
•QIDERR
![Page 149: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/149.jpg)
CICS Transactions
• CSSN: Sign-On
• CEBR: Temporary Storage Browse
• CECI: Command Level Interface
• CEDF: Execution Diagnostic Facility
• CEMT: Master Terminal Transaction
• CEDA: Resource Definition Online
• CSSF: Sign-Off
![Page 150: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/150.jpg)
CICS Transactions
• CSSN
•Enables CICS to associate user with the terminal
•Name and password should be defined in a SignoN Table(SNT)
• CEBR
•It browses TSQ
•Content of TSQ can be displayed
• CECI
•It performs syntax checking of a CICS command.
•If syntax is correct, it will execute the command.
![Page 151: CICS by Pai](https://reader033.vdocument.in/reader033/viewer/2022061204/547ebb9db4af9fe4528b456f/html5/thumbnails/151.jpg)
CICS Transactions
• CEMT
•It manipulates the CICS environment
• It provides the facility to
•INQUIRE about the CICS environment
•SET or update the status of CICS environment
•PERFORM further system operations