Top Banner
Copyright © 2003 by Patni Version 2.0
153
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: V2_CICS_ppt

Copyright © 2003 by Patni

Version 2.0

Page 2: V2_CICS_ppt

Copyright © 2003 by Patni

Day-wise Schedule

Day 1Introduction To CICSSystem ComponentsData Communication Operation in CICSCharacteristics of CICSCommand Level ProgrammingCICS COPY BOOKS

Day 2BMS Programming ConsiderationsExceptional ConditionsTerminal Control Operations

Page 3: V2_CICS_ppt

Copyright © 2003 by Patni

Day-wise Schedule

Day 3Interval Control OperationsProgram Control OperationsFile Control Operations

Day 4Advanced File Control OperationsTemporary Storage ControlCICS transactions

Day 5CICS transactions continuedAssignment Completion

Page 4: V2_CICS_ppt

Copyright © 2003 by Patni

Introduction To CICS

Feature Batch On-LineData Collection Off-Line On-LineInput Sequential In Batch RandomJob Schedule At specific intervals InstantaneousResources Not Sharable SharableResponse Time Not Critical CriticalOutput In Printed Format On the TerminalSecurity Simple ComplexRecovery Simple ComplexInformation Not always current Always current Updation In Batch Immediate

Page 5: V2_CICS_ppt

Copyright © 2003 by Patni

Introduction To CICSInteractive Programs

Data Entry ProgramInquiry ProgramFile Maintenance ProgramMenu Program

Interactive System Considerations Shared FilesResponse TimeSecurityRecovery

Page 6: V2_CICS_ppt

Copyright © 2003 by Patni

Introduction To CICS

CICS acts as an interface between the Operating system and application programs

ApplicationProgram

CICS

Op. System

Page 7: V2_CICS_ppt

Copyright © 2003 by Patni

Introduction To CICS

CICS System ConceptData-Communication FunctionsData Handling FunctionsApplication Program ServicesSystem ServicesMonitoring Functions

Page 8: V2_CICS_ppt

Copyright © 2003 by Patni

Operating System (MVS/XA)

Database Data Access TelecommunicationAccess 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 ApplicationProgram Services CICS Application programs (COBOL, PL/I, Assembler)

Other Systems

Page 9: V2_CICS_ppt

Copyright © 2003 by Patni

Introduction To CICS

Features Of CICSDB/DCMultiprogrammingMultitaskingScheduling

Page 10: V2_CICS_ppt

Copyright © 2003 by Patni

System Components

Management Modules

Tables

Control Blocks

Page 11: V2_CICS_ppt

Copyright © 2003 by Patni

System Components

Management ModulesAre the CICS/MVS program that interface between the operating system and the application program.Each management module performs a particular function.

TablesDefines the CICS/MVS system’s environment.The tables are functionally associated with the management modules.

Page 12: V2_CICS_ppt

Copyright © 2003 by Patni

System Components

Control Blocks

Contain system type information

Page 13: V2_CICS_ppt

Copyright © 2003 by Patni

Management Modules

TerminalControl Basi

cMappingSupport

ProgramControl

TaskControl

IntervalControl

TransientDataControl

TemporaryStorageControl

JournalControl

StorageControl

DumpControl

TraceControl

FileControl

Nucleus

Page 14: V2_CICS_ppt

Copyright © 2003 by Patni

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 terminalHandles hardware communication requirementRequests initiation of the new tasksBMS is an interface between application program and Terminal Control program management module.

Page 15: V2_CICS_ppt

Copyright © 2003 by Patni

Management Modules

Task control Program Management Module (KCP)Creates a task for the transaction requestedChecks the validity of the transaction-id and the authority of the operator.Allocates processor time among the tasksKeeps control of the status of all CICS tasks being processed concurrentlyTransaction request can be made eitherBy entering transaction Id at the terminalBy another CICS transaction

Page 16: V2_CICS_ppt

Copyright © 2003 by Patni

Management ModulesProgram Control Program Management Module (PCP)

Manages the flow of control within taskResponsible 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 CICSUses 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: V2_CICS_ppt

Copyright © 2003 by Patni

Management Modules

File Control program Management Module (FCP)Manages file processing activities of each application programFCP 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: V2_CICS_ppt

Copyright © 2003 by Patni

Management Modules

Storage Control Program Management Module (SCP)

Maintains full control over the virtual storageAcquires, controls and releases dynamic storage during execution of a taskAllocation of main storage is automaticControls requests for the main storage

Page 19: V2_CICS_ppt

Copyright © 2003 by Patni

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: V2_CICS_ppt

Copyright © 2003 by Patni

TablesSome of the important tables in CICS/MVS are:

FCT: File Control TablePCT: Program Control TablePPT: Processing Program TableTCT: Terminal Control TableDCT: Destination Control TableSIT: System Initialization Table

Page 21: V2_CICS_ppt

Copyright © 2003 by Patni

Control BlocksDynamically 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: V2_CICS_ppt

Copyright © 2003 by Patni

Data Communication Operation In CICS

Terminal Control Program Management Module (TCP)

Basic Mapping Support (BMS)

Batch Data Interchange (BDI)

Page 23: V2_CICS_ppt

Copyright © 2003 by Patni

Data Communication Operation In CICS

Terminal Control Program Management Module (TCP)Is the basic method for communicating with devicesBMS and BDI use terminal control facilities when invoked by an application program

Basic Mapping Support (BMS)Interface between TCP and application programProvides commands and options that can be used to format data in a standard mannerIt converts data streams provided by the application program to conform to the requirements of devices.Facilitates development of device & format independent programs

Page 24: V2_CICS_ppt

Copyright © 2003 by Patni

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 programBMS makes the application program Format Independent and Device Independent

Page 25: V2_CICS_ppt

Copyright © 2003 by Patni

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: V2_CICS_ppt

Copyright © 2003 by Patni

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: V2_CICS_ppt

Copyright © 2003 by Patni

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 macrosScreen Definition Facility (SDF)

Map represents BMS coding for a screen, and Mapset represents a load module

Page 28: V2_CICS_ppt

Copyright © 2003 by Patni

Map Generation

Design Screen

Code Map

Assemble

Symbolic MapPhysical Map

Load LibraryContains Literals

Source LibraryContains Data-

fields

Page 29: V2_CICS_ppt

Copyright © 2003 by Patni

Physical Map

Describes display format for a given terminal typeIt includes

The format of input & output dataThe fixed data such as page headingsSymbolic names of variable data-fieldsThe device type to which map relates.

Physical Map GenerationBMS macro coding Assembly Link-edit Load Module LOADLIB To be used by CICS

Page 30: V2_CICS_ppt

Copyright © 2003 by Patni

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: V2_CICS_ppt

Copyright © 2003 by Patni

Map and Mapset

MapA representation of one screen format is called a mapOne or group of maps makes up a mapset

MapsetA group of maps, which are linkedited together is called mapsetEach mapset must be registered in PPT

Page 32: V2_CICS_ppt

Copyright © 2003 by Patni

Map and Mapset

MapsetThe mapset name consists of two parts as follows:

Generic Name: 1 to 7 charactersSuffix: 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: V2_CICS_ppt

Copyright © 2003 by Patni

Components Of A Screen

CICS identifies screen into three components:

MapsetMaps

Physical MapSymbolic Map

FieldsUnnamed (Literals)Named (Data fields)Stopper

Page 34: V2_CICS_ppt

Copyright © 2003 by Patni

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

Protection Intensit

yMD

T

Attribute Byte Bit Position :`

Page 35: V2_CICS_ppt

Copyright © 2003 by Patni

Positions Functions Bit Settings

0-1 Information about bits 2 thru 72-3 protection 00 = Unprotected alphanumeric01 = Unprotected numeric10 = Protected11 = skip4-5 Intensity 00 = Normal01 = Normal10 = Bright11 = No-display6 Must be 07 MDT 0 = Field has not been modified1 = Field has been modified

Attribute Byte Format

Page 36: V2_CICS_ppt

Copyright © 2003 by Patni

Attribute Byte Format

Field ProtectionUnprotectedProtectedAuto-skip

Field IntensityNormalBrightNo-display

Shift

Page 37: V2_CICS_ppt

Copyright © 2003 by Patni

Modified Data Tag (MDT)

MDT is the one bit of the attribute characterIf 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: V2_CICS_ppt

Copyright © 2003 by Patni

Modified Data Tag (MDT)

Following are the three ways to set MDT ON:

By Data-entryBy setting attribute byte in the physical mapBy moving MDT attribute in the application program

Page 39: V2_CICS_ppt

Copyright © 2003 by Patni

Map Definition Macros

Available Macros

DFHMSDDFHMDIDFHMDFGeneral Format

Col1 Col 10 Col16 Col17 Col72

Symbolic Opcode Parameter(s) Cont’d Name Additional parameters Char.

Page 40: V2_CICS_ppt

Copyright © 2003 by Patni

Map Definition Macros

Example

1 10 16 17 72

MENU DFHMSD TYPE=&SYSPARM XMODE=INOUT,LANG=COBOL…..

Page 41: V2_CICS_ppt

Copyright © 2003 by Patni

Map Definition Macros

Order of Map-Code

Print Nogen ----> Assembler CommandLabel DFHMSD ----> Mapset Definition

Label DFHMDI ----> Map DefinitionDFHMDF ----> Field DefinitionLabel DFHMDF ----> Field DefinitionMap1 |||DFHMDF

DFHMDIMap2 DFHMDF|| |DFHMDFDFHMSD Type = Final --> Mapset DefinitionEnd -------------------> Assembler command

Page 42: V2_CICS_ppt

Copyright © 2003 by Patni

DFHMSD Macro

FunctionThe 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: V2_CICS_ppt

Copyright © 2003 by Patni

DFHMSD Macro

End of Mapset Definition

DFHMSD TYPE=FINAL

Page 44: V2_CICS_ppt

Copyright © 2003 by Patni

DFHMDI Macro

FunctionThe 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: V2_CICS_ppt

Copyright © 2003 by Patni

DFHMDF Macro

FunctionThe 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: V2_CICS_ppt

Copyright © 2003 by Patni

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: V2_CICS_ppt

Copyright © 2003 by Patni

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: V2_CICS_ppt

Copyright © 2003 by Patni

Characteristics Of CICS

Multithreading

Quasi-Reentrancy

Pseudo-Conversational Programming

Transaction Driven

Page 49: V2_CICS_ppt

Copyright © 2003 by Patni

Quasi-Reentrant Program

VirtualStorageProgram AObject Code

Program AWorkingStorage(User1)

Program AWorkingStorage(User2)

User 1Running Program A

User 2RunningProgram A

Page 50: V2_CICS_ppt

Copyright © 2003 by Patni

Command Level Programming

CICS Program Development

Macro Level Programming

Command Level Programming

Page 51: V2_CICS_ppt

Copyright © 2003 by Patni

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: V2_CICS_ppt

Copyright © 2003 by Patni

CICS Command Format

EXEC CICS Function[option(argument)option(argument)----------------]END-EXEC.

Page 53: V2_CICS_ppt

Copyright © 2003 by Patni

Command Language Translator

COBOL SourceProgram

Translator

Translated SourceProgram

COBOL Compiler

Object Module

Link Edit

Load Module

Page 54: V2_CICS_ppt

Copyright © 2003 by Patni

COBOL/CICS Program Structure

IDENTIFICATION DIVISION.PROGRAM-ID.ENVIRONMENT DIVISION.DATA DIVISION.WORKING-STORAGE SECTION.Variable declarationFile layoutSymbolic mapCopy books DFHEIVARLINKAGE SECTION.DFHCOMMAREAEIBBLOCKBLL CELLSPROCEDURE DIVISION.

Page 55: V2_CICS_ppt

Copyright © 2003 by Patni

COBOL/CICS Program Structure

The following COBOL statements are prohibited in a CICS application program:

ACCEPT, CURRENT-DATE, DATE DAY, DISPLAY, EXHIBIT, STOP RUN, TRACEAny I/O statements (OPEN, CLOSE, READ, WRITE, REWRITE, DELETE, STARTREPORT WRITER FeatureSORT Feature

Page 56: V2_CICS_ppt

Copyright © 2003 by Patni

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/LINKThe 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: V2_CICS_ppt

Copyright © 2003 by Patni

Passing the data using COMMAREA

If no data is passed then EIBCALEN is equal to zeroIf 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: V2_CICS_ppt

Copyright © 2003 by Patni

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: V2_CICS_ppt

Copyright © 2003 by Patni

CICS COPY BOOKS

Some of the EIB fields are EIBAID

EIBCALENEIBCPOSNEIBDATEEIBTIMEEIBDSEIBRODEEIBREQIDEIBRESPEIBTRMIDEIBTRNIDEIBTASKN

Page 60: V2_CICS_ppt

Copyright © 2003 by Patni

CICS COPY BOOKS

Standard Attribute Byte ListDFHBMSCAConstants 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: V2_CICS_ppt

Copyright © 2003 by Patni

CICS COPY BOOKS

Installation Defined

01 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: V2_CICS_ppt

Copyright © 2003 by Patni

CICS COPY BOOKS

Installation Defined Message File01 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: V2_CICS_ppt

Copyright © 2003 by Patni

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 CICSAID 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: V2_CICS_ppt

Copyright © 2003 by Patni

CICS COPY BOOKS

The DFHAID member contains such AID codes as:

DFHENTER: ENTER keyDFHCLEAR: CLEAR keyDFHPA1-3: PA1 TO PA3 keysDFHPF1-24: PF1 TO PF24 keys

Example

IF EIBAID = DFHPF3PERFORM 2100-END-ROUTINEELSE IF EIBAID = DFHPA1PERFORM 2200-CANCEL-ROUTINEELSE IF EIBAID = DFHENTERPERFORM 2300-NORMAL-ROUTINEELSEPERFORM 2400-WRONG-ROUTINE.

Page 65: V2_CICS_ppt

Copyright © 2003 by Patni

Application Program Housekeeping

Exceptional ConditionsAn 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 commandIGNORE CONDITION commandNOHANDLE option

Page 66: V2_CICS_ppt

Copyright © 2003 by Patni

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: V2_CICS_ppt

Copyright © 2003 by Patni

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: V2_CICS_ppt

Copyright © 2003 by Patni

HANDLE CONDITION Command

Example:2110-RECEIVE-CHOICE SECTION.EXEC CICS HANDLE CONDITIONMAPFAIL(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: V2_CICS_ppt

Copyright © 2003 by Patni

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 CONDITIONcondition[condition]END-EXEC.

Page 70: V2_CICS_ppt

Copyright © 2003 by Patni

IGNORE CONDITION Command

Example

EXEC CICS IGNORE CONDITIONLENGERREND-EXEC. EXEC CICS RECEIVE MAP(‘MAP1’) MAPSET(‘MAP1’)INTO(MAP1I)LENGTH(80)END-EXEC.

Page 71: V2_CICS_ppt

Copyright © 2003 by Patni

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 commandExample

EXEC CICS SENDMAP(----)MAPSET(------)FROM(------)LENGTH(---)NOHANDLEEND-EXEC.

Page 72: V2_CICS_ppt

Copyright © 2003 by Patni

NOHANDLE Option

RESP optionIf RESP option is specified in a command, CICS places a response code at a completion of the commandThe 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: V2_CICS_ppt

Copyright © 2003 by Patni

NOHANDLE Option

Example:

EXEC CICS RECEIVEMAP(----)MAPSET(------)INTO(------)LENGTH(---)NOHANDLERESP(WS-RESP-FIELD)END-EXEC.IF WS-RESP-FIELD = DFHRESP(NORMAL)-----------ELSE IF WS-RESP-FIELD = DFHRESP(MAPFAIL)-----------

Page 74: V2_CICS_ppt

Copyright © 2003 by Patni

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 AIDOption(label)END-EXEC.

Page 75: V2_CICS_ppt

Copyright © 2003 by Patni

HANDLE AID Command

Commonly used OptionsAny key name (PA1 to PA3, PF1 to PF24, ENTER, CLEARANYKEY (Any of the above except ENTER key)

Example:EXEC CICS HANDLE AIDPF3(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: V2_CICS_ppt

Copyright © 2003 by Patni

Disadvantage of Using HANDLE AID Command

Page 77: V2_CICS_ppt

Copyright © 2003 by Patni

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 userCICS 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: V2_CICS_ppt

Copyright © 2003 by Patni

BMS Programming Considerations

Dynamic attribute Character Assignment

Cursor Positioning Techniques

Page 79: V2_CICS_ppt

Copyright © 2003 by Patni

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: V2_CICS_ppt

Copyright © 2003 by Patni

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 SENDMAP ('MAPNAME')MAPSET('MAPSETA')FROM(MAPSETAI)END-EXEC.

Page 81: V2_CICS_ppt

Copyright © 2003 by Patni

Cursor Positioning Techniques

Static Cursor Positioning

Dynamic/Symbolic Cursor Positioning

Relative Cursor Positioning

Page 82: V2_CICS_ppt

Copyright © 2003 by Patni

Cursor Positioning Techniques

Static Cursor PositioningIn 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 fieldIf 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: V2_CICS_ppt

Copyright © 2003 by Patni

Cursor Positioning Techniques

Symbolic Cursor PositioningIn 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).ExampleMOVE –1 TO CHOICEL.EXEC CICS SEND MAP(‘MAP1’)MAPSET(‘MAP1’)CURSORERASEEND-EXEC.

Page 84: V2_CICS_ppt

Copyright © 2003 by Patni

Cursor Positioning Techniques

Relative Cursor PositioningIn 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 timeData-value is calculated as: (row-1) * 80 + (column –1)Example

EXEC CICS SENDMAP(------)MAPSET(-------)CURSOR(100)ERASEEND-EXEC.

Page 85: V2_CICS_ppt

Copyright © 2003 by Patni

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: V2_CICS_ppt

Copyright © 2003 by Patni

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+LFieldname+FFieldname+I

Page 87: V2_CICS_ppt

Copyright © 2003 by Patni

RECEIVE MAP Command (Formatted Data Transfer)

Format

EXEC CICS RECEIVE MAP(map name)MAPSET(mapset name)INTO(data-area)END-EXEC.

Page 88: V2_CICS_ppt

Copyright © 2003 by Patni

RECEIVE MAP Command (Formatted Data Transfer)

Common Exceptional Conditions

MAPFAILIf 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: V2_CICS_ppt

Copyright © 2003 by Patni

SEND MAP Command (Formatted Data Transfer)

FunctionThis 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+LFieldname+AFieldname+O

Page 90: V2_CICS_ppt

Copyright © 2003 by Patni

SEND MAP Command (Formatted Data Transfer)

FormatEXEC 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: V2_CICS_ppt

Copyright © 2003 by Patni

SEND MAP Command (Formatted Data Transfer)

ExampleWORKING-STORAGE SECTION.---------------COPY MAPA.--------------PROCEDURE DIVISION.--------------EXEC CICS HANDLE CONDITIONINVMPSZ(BIG-MAP)END-EXEC.---------------EXEC CICS SEND MAP MAP(‘MAPA’)MAPSET(‘MAPA’)FROM(MAPAI)END-EXEC.BIG-MAP.ERROR PROCESSING……………

Page 92: V2_CICS_ppt

Copyright © 2003 by Patni

RECEIVE Command (Unformatted Data Transfer)

FunctionThis 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: V2_CICS_ppt

Copyright © 2003 by Patni

SEND TEXT Command (Unformatted Data Transfer)

FunctionThis command is used to send unformatted messageThis message will always get displayed at row 1, column 1 position on the screen.

FormatEXEC CICS SEND TEXT FROM(data-area)LENGTH(data-value)[ERASE][FREEKB]END-EXEC.

Page 94: V2_CICS_ppt

Copyright © 2003 by Patni

Interval Control Operations

ASKTIME Command

FORMATTIME Command

Page 95: V2_CICS_ppt

Copyright © 2003 by Patni

ASKTIME Command

FunctionThis 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: V2_CICS_ppt

Copyright © 2003 by Patni

FORMATTIME Command

FunctionThis command is used to receive the information of date and time in various formats.

FormatEXEC 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: V2_CICS_ppt

Copyright © 2003 by Patni

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: V2_CICS_ppt

Copyright © 2003 by Patni

RETURN Command

Format

EXEC CICS RETURN[TRANSID(name)[COMMAREA(data-area)[LENGTH(data-value)]]]END-EXEC.

Page 99: V2_CICS_ppt

Copyright © 2003 by Patni

LINK and XCTL Command

Function of LINK CommandIt 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 LINKProgram B Higher Logical Level RETURN Lower Logical Level

Page 100: V2_CICS_ppt

Copyright © 2003 by Patni

LINK and XCTL Command

Format Of LINK Command

EXEC CICS LINKPROGRAM(name)[COMMAREA(data-area)][LENGTH(data-value)]END-EXEC.

Page 101: V2_CICS_ppt

Copyright © 2003 by Patni

LINK and XCTL Command

Function of XCTL CommandUsed to pass control from one application program to another application program at the same logical level.

Format Of XCTL Command

EXEC CICS XCTLPROGRAM(name)[COMMAREA(data-area)][LENGTH(data-value)]END-EXEC.

Page 102: V2_CICS_ppt

Copyright © 2003 by Patni

LINK and XCTL Command

Common Exceptional Conditions

NOTAUTHPGMIDERR

Page 103: V2_CICS_ppt

Copyright © 2003 by Patni

XCTL vs LINK

Calling program is released from the main memoryControl is transferred to the same logical levelReturn can be to CICS or to the application programCOMMAREA option can be used to pass data to the invoked program

Calling program is not released from the main memoryControl is transferred tosame logical levelReturn is always to the application programCOMMAREA 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: V2_CICS_ppt

Copyright © 2003 by Patni

File Control Operations (Random Access)

Supported Access MethodsCICS 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: V2_CICS_ppt

Copyright © 2003 by Patni

File Control Operations (Random Access)

Available Commands

READ: To read a record directlyWRITE: To newly write a recordREWRITE: To update an existing recordDELETE: To delete a recordUNLOCK: To release exclusive control acquired for update

Page 106: V2_CICS_ppt

Copyright © 2003 by Patni

File Control Operations (Random Access)

Special services of File Control Program

Data Independence

Exclusive control during updates

File Open/Close

Page 107: V2_CICS_ppt

Copyright © 2003 by Patni

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: V2_CICS_ppt

Copyright © 2003 by Patni

READ Command Using Full Key

Format

EXEC CICS READDATASET(name) INTO(data-area)RIDFLD(data-area)LENGTH(data-value)END-EXEC.

Example

Page 109: V2_CICS_ppt

Copyright © 2003 by Patni

READ Command Using Full Key

Common Exceptional conditions

DUPKEY

NOTFND

LENGERR

NOTOPEN

Page 110: V2_CICS_ppt

Copyright © 2003 by Patni

READ Command Using GENERIC Option

FunctionThe READ command with the GENERIC option is used to read a nonspecific record based on the generic key specified.This is useful when you do not know the complete information of the key

Format/ExampleMOVE 35 TO WK-LEN.MOVE ‘NY’ TO REC-A-KEY.EXEC CICS READDATASET(‘FILE2’)INTO(FILE-OAREA)RIDFLD(REC-A-KEY) KEYLENGTH(2) GENERIC LENGTH(WK-LEN)END-EXEC.

Page 111: V2_CICS_ppt

Copyright © 2003 by Patni

READ Command Using GENERIC Option

Common Exceptional Conditions

NOTFND

LENGERR

INVREQ

Page 112: V2_CICS_ppt

Copyright © 2003 by Patni

READ Command Using GTEQ Option

FunctionThe 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/ExampleMOVE 35 TO WK-LEN.MOVE ‘NY003’ TO REC-KEY. •=must be a full keyEXEC CICS READDATASET(‘FILE2’)INTO(FILE-IOAREA)RIDFLD(REC-A-KEY)GTEQ LENGTH(WK-LEN)END-EXEC.

Page 113: V2_CICS_ppt

Copyright © 2003 by Patni

READ/UPDATE and REWRITE CommandsFunction

A combination of the READ command with the UPDATE option and the REWRITE command is used to update a record.

Format/ExampleMOVE 35 TO WK-LEN.MOVE ‘NY001’ TO REC-A-KEY.EXEC CICS READDATASET(‘FILE2’)INTO(FILE-IOAREA)RIDFLD(REC-A-KEY)UPDATELENGTH(WK-LEN)END-EXEC. •=read for updatingSet of MOVE Statements………EXEC CICS REWRITEDATASET(‘FILE2’)FROM(FILE-IOAREA)LENGTH(WK-LEN)END-EXEC.

Page 114: V2_CICS_ppt

Copyright © 2003 by Patni

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 UNLOCKDATASET(‘FILE2’)END-EXEC.

Page 115: V2_CICS_ppt

Copyright © 2003 by Patni

WRITE Command

FunctionThis command is used to write a record directly into a file based on the key specified.

FormatEXEC CICS WRITEDATASET(name)FROM(data-area)LENGTH(data-value)RIDFLD(data-area)END-EXEC.

Page 116: V2_CICS_ppt

Copyright © 2003 by Patni

WRITE Command

Example

MOVE 35 TO WK-LEN.MOVE ‘NY004’ TO REC-A-KEY.Move symbolic map fields to the record area……EXEC CICS WRITEDATASET(‘FILE2’)FROM(FILE-IOAREA)RIDFLD(REC-A-KEY)LENGTH(WK-LEN)END-EXEC.

Page 117: V2_CICS_ppt

Copyright © 2003 by Patni

WRITE Command

Exceptional Conditions

DUPREC

NOSPACE

LENGERR

Page 118: V2_CICS_ppt

Copyright © 2003 by Patni

WRITE Command with MASSINSERT Option

FunctionThe WRITE command with the MASSINSERT option is used to add a group of records whose keys are in ascending order into a file.

ProceduresEstablish the first record keyIssue the WRITE command with the MASSINSERT option.Increment the key the ascending order.Repeat steps 2 and 3 until all records have been writtenIssue the UNLOCK command to release the exclusive control over the file.

Page 119: V2_CICS_ppt

Copyright © 2003 by Patni

WRITE Command with MASSINSERT Option

Format/ExamplePROCEDURE DIVISION

……..MOVE ‘TX000’ TO REC-A-KEY’.MASS-INS-LOOP SECTION.ADD 1 TO REC-A-KEY-SEQ.…….(Prepare the record content)…….EXEC CICS WRITEDATASET(‘FILE2’)FROM(FILE-IOAREA)RIDFLD(REC-A-KEY)LENGTH(WK-LEN)MASSINSERT END-EXEC.IF REC-A-SEQ < 99GO TO MASS-INS-LOOP.EXEC CICS UNLOCKDATASET(‘FILE2’) END-EXEC.

Page 120: V2_CICS_ppt

Copyright © 2003 by Patni

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 ApproachDirect DELETE ApproachGroup Record DELETE Approach

Page 121: V2_CICS_ppt

Copyright © 2003 by Patni

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 122: V2_CICS_ppt

Copyright © 2003 by Patni

DELETE after READ/UPDATE Approach

Format/Example

MOVE 35 TO WK-LEN.MOVE ‘NY001’ TO REC-A-KEY.EXEC CICS READDATASET(‘FILE2’)INTO(FILE-IOAREA)RIDFLD(REC-A-KEY)UPDATELENGTH(WK-LEN)END-EXEC.……EXEC CICS DELETEDATASET(‘FILE2’)END-EXEC.

Page 123: V2_CICS_ppt

Copyright © 2003 by Patni

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 DELETEDATASET (‘FILE2’)RIDFLD(REC-A-KEY) •= requiredEND-EXEC.

Page 124: V2_CICS_ppt

Copyright © 2003 by Patni

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 DELETEDATASET(‘FILE2’)RIDFLD(‘REC-A-KEY’)KEYLENGTH(2)GENERICNUMREC(WK-DEL-COUNT)END-EXEC.

Page 125: V2_CICS_ppt

Copyright © 2003 by Patni

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 operationREADNEXT : To read a next record (Forward)READPREV : To read a previous record (backward)RESETBR : To reestablish another position for a new browseENDBR : To complete a browse operation.

Page 126: V2_CICS_ppt

Copyright © 2003 by Patni

STARTBR Command

FunctionThis command is used to establish a browse starting position for a file.

FormatEXEC CICS STARTBRDATASET(name)RIDFLD(data-area)GTEQ/EQUAL[KEYLENGTH(data-area)GENERIC]RBA/RRNEND-EXEC

Page 127: V2_CICS_ppt

Copyright © 2003 by Patni

STARTBR Command

ExampleWORKING-STORAGE SECTION.77 WK-LEN PIC S9(4) COMP.01 FILE-IOAREA.05 REC-A-KEY.10 REC-A-KEY-CITY PIC XX.10 REC-A-KEY-SE PIC 999.05 REC-A-DETAIL PIC X(30).PROCEDURE DIVISION.:MOVE ‘NY000’ TO RE-A-KEY.EXEC CICS STARTBRDATASET (‘FILE2’)RIDFLD(REC-A-KEY) GTEQ •= defaultEND-EXEC.

Page 128: V2_CICS_ppt

Copyright © 2003 by Patni

STARTBR Command

Exceptional Conditions

DSIDERR

NOTFND

Page 129: V2_CICS_ppt

Copyright © 2003 by Patni

READNEXT Command

FunctionThe READNEXT command is used to read a record of a file sequentially forward.

FormatEXEC CICS READNEXT

DATASET(name)INTO(data-area)LENGTH(data-value)RIDFLD(data-area)RBA/RRNEND-EXEC.

Page 130: V2_CICS_ppt

Copyright © 2003 by Patni

READNEXT Command

Exceptional ConditionsDUPKEYENDFILELENGERR

Page 131: V2_CICS_ppt

Copyright © 2003 by Patni

READPREV Command

FunctionThis command is used to read a record of a file backward.

Format/Example

Exceptional ConditionsNOTFNDINVREQ

Page 132: V2_CICS_ppt

Copyright © 2003 by Patni

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 133: V2_CICS_ppt

Copyright © 2003 by Patni

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 134: V2_CICS_ppt

Copyright © 2003 by Patni

RESETBR Command

FunctionThis 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 135: V2_CICS_ppt

Copyright © 2003 by Patni

ENDBR Command

FunctionAt physical end of file or logical end of file, the browser operation is terminated using this command.

Format/Example

EXEC CICS ENDBRDATASET(‘FILE2’)END-EXEC.

Page 136: V2_CICS_ppt

Copyright © 2003 by Patni

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 137: V2_CICS_ppt

Copyright © 2003 by Patni

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 138: V2_CICS_ppt

Copyright © 2003 by Patni

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 139: V2_CICS_ppt

Copyright © 2003 by Patni

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 140: V2_CICS_ppt

Copyright © 2003 by Patni

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 141: V2_CICS_ppt

Copyright © 2003 by Patni

WRITEQ TS Command (No Update)

FunctionThis 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 142: V2_CICS_ppt

Copyright © 2003 by Patni

WRITEQ TS Command (No Update)

Common Options

NOSUSPENDAUXILIARY

Exceptional Condition

NOSPACE

Page 143: V2_CICS_ppt

Copyright © 2003 by Patni

READQ TS Command (Direct Read)

FunctionThis command is used to read a particular record (item) of a particular TSQ.

Format/Example EXEC CICS READQ TSQUEUE(TSQ-QID)INTO(TSQ-DATA)LENGTH(TSQ-LEN)ITEM(TSQ-ITEM)END-EXEC.

Page 144: V2_CICS_ppt

Copyright © 2003 by Patni

READQ TS Command (Direct Read)

Commonly Used Options

NUMITEMSNEXT

Exceptional Condition

QIDERRITEMERR

Page 145: V2_CICS_ppt

Copyright © 2003 by Patni

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 techniques, instead of NEXT option of the READQ TS command.

Format/Example

Page 146: V2_CICS_ppt

Copyright © 2003 by Patni

*ESTABLISH HANDLE CONDITION.EXEC CICS HANDLE CONDITIONITEMERR(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 147: V2_CICS_ppt

Copyright © 2003 by Patni

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 148: V2_CICS_ppt

Copyright © 2003 by Patni

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 149: V2_CICS_ppt

Copyright © 2003 by Patni

EXEC CICS READQ TSQUEUE(TSQ-QID)INTO(TSQ-DATA)LENGTH(TSQ-LEN)ITEM(TSQ-ITEM)END-EXEC.:*Process data in TSQ-DATA:EXEC CICS WRITEQ TSQUEUE(TSQ-QID)FROM(TSQ-DATA)LENGTH(TSQ-LEN)ITEM(TSQ-ITEM)REWRITEMAINEND-EXEC.

WRITEQ TS Command with REWRITE Option

Page 150: V2_CICS_ppt

Copyright © 2003 by Patni

DELETEQ TS Command

FunctionThis command is used to delete a TSQ entirely

Format/Example

EXEC CICS DELETEQ TSQUEUE(TSQ-ID)END-EXEC.

Exceptional ConditionQIDERR

Page 151: V2_CICS_ppt

Copyright © 2003 by Patni

CICS Transactions

CSSN: Sign-OnCEBR: Temporary Storage BrowseCECI: Command Level InterfaceCEDF: Execution Diagnostic FacilityCEMT: Master Terminal TransactionCEDA: Resource Definition OnlineCSSF: Sign-Off

Page 152: V2_CICS_ppt

Copyright © 2003 by Patni

CICS Transactions

CSSNEnables CICS to associate user with the terminalName and password should be defined in a SignoN Table(SNT)

CEBRIt browses TSQContent of TSQ can be displayed

CECIIt performs syntax checking of a CICS command.If syntax is correct, it will execute the command.

Page 153: V2_CICS_ppt

Copyright © 2003 by Patni

CICS Transactions

CEMTIt manipulates the CICS environment

It provides the facility to

INQUIRE about the CICS environmentSET or update the status of CICS environmentPERFORM further system operations