+ All Categories
Home > Documents > IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

Date post: 01-Jan-2016
Category:
Upload: jeffry-beasley
View: 213 times
Download: 0 times
Share this document with a friend
66
| IBM Global Services © Copyright IBM Corporation 2004 INTRODUCTION TO CICS Pavani D Feb 23, 2007
Transcript
Page 1: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

INTRODUCTION TO CICS

Pavani DFeb 23, 2007

 

Page 2: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

OBJECTIVES

     Batch & Online systems

 

     Why CICS?

 

     CICS System components

 

     CICS control program & tables

 

     CICS startup and shutdown

Page 3: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

BATCH & ONLINE SYSTEM

ONLINE processing allows a user to interact with a computer and access its resources via a terminal

Example : Railway Reservation system

Transaction file

Batch System

MASTER FILE

Batch System

REPORTS

DATABASE

OnlineSystem

Online System

Terminals

Page 4: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

BATCH & ONLINE SYSTEM

BATCH ONLINE

Input Data from card tape, disk Batched, sequential, scheduled

Data from terminal random, concurrent

Start of

A job

Operator (or operating system) initiates the job. Other jobs in the same region must wait.

Once CICS is initialized, entering transaction id triggers the transaction to start.

Processing

Mode

Single task single thread. Priority in job scheduling

Multi task multi thread. Priority processing.

End of job Each job Each transaction. Once CICS is terminated, no transactions can be entered.

Page 5: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

BATCH & ONLINE SYSTEM Contd….

BATCH ONLINE

Output printed reports, output files. User must wait for batch jobs to produce reports (day, week, month)

Message terminals updated files, system

 Instant feed back

Resource

Usage

Less More

Example

of

application

Monthly sales report Airline reservation system

Page 6: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

WHAT IS CICS?

    Customer Information Control System (CICS) was developed in 1960 by IBM

 

 It is one of the Original ONLINE TRANSACTION PROCESSING(OLTP) managers

 

General purpose data base / data communication (DB/DC) control system

 

Provides services to handle all the special requirements for online processing

Page 7: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

ROLE OF CICS

Role of CICS is to interface between application programs and the DB/DC control system.

Operating System (MVS/XA)

DatabaseAccessMethod

(DL/I, DB@)

DatabaseMethod(VSAM/BDAM)

TelecommunicationAccess method(VTAM,TCAM,

BTAM)

OtherSystems

TerminalsCICS / MVS

DataStorage

Page 8: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

CICS / VS CONTROL

CICS TABLES

TASK CONTROL

PROGRAM CONTROL

TERMINALCONTROL

FILECONTROL

TERMINAL

FILES

PROGRAM LIBRARY

Page 9: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

CICS CONTROL PROGRAM AND TABLES

    CICS CONTROL PROGRAM

(IBM SUPPLIED)

   FCP (FILE CONTROL PROGRAM)

 JCP (JOURNAL CONTROL PROGRAM)

 KCP (TASK CONTROL PROGRAM)

 PCP (PROGRAM CONTROL PROGRAM)

 SCP (STORAGE CONTROL PROGRAM)

 TCP (TERMINAL CONTROL PROGRAM)

 TDP (TRANSIENT DATA PROGRAM)

 TSP (TEMPORARY STORAGE PROGRAM)

OTHERS

Page 10: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

CICS CONTROL PROGRAM AND TABLES - Contd…

   CICS CONTROL TABLES

       (USER SPECIFIED)

   FCT (FILE CONTROL TABLE)

   JCT (JOURNAL CONTROL TABLE)

   PCT (PROGRAM CONTROL TABLE)

   PPT (PROCESSING PROGRAM TABLE)

   TCT (TERMINAL CONTROL TABLE)

   DCT (DESTINATION CONTROL TABLE)

   TST (TEMPORARY STORAGE TABLE)

Page 11: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

CICS START UP

CICS is submitted as a batch job.

CICS System Initialization program (SIP) is the main job step

SIP loads System Initialization Table (SIT)

SIP further loads all control programs and tables

Perform initial housekeeping tasks

 

Page 12: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

CICS SHUTDOWN

• Master terminal transaction is entered with shutdown option

• CICS job produces various logs, statistics, dumps and other reports and ends

• No transaction can be executed after the CICS job is brought down.

 

Page 13: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

ROLE OF CICS

MULTI TASKING - More than one task can be executed concurrently.

MULTI THREADING - Tasks share the same program under the multi tasking environment.

RE-ENTRANT PROGRAM - Program which does not modify itself in any way during execution.

QUASI RE-ENTRANT - Is a reentrant program under the CICS environment.

Page 14: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

STRUCTURE OF CICS APPLICATION PROGRAM

  Identification DivisionIdentification Division

          Program - ID requiredProgram - ID required

            Other comments as below, are optional but recommendedOther comments as below, are optional but recommended

   -- AuthorAuthor

-- Date-WrittenDate-Written

-- Date-compiledDate-compiled

-- RemarksRemarks

    Environment DivisionEnvironment Division

   -- Only header is requiredOnly header is required

Page 15: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

STRUCTURE OF CICS APPLICATION PROGRAM - Contd…

The following COBOL statements are prohibited.The following COBOL statements are prohibited.

o ACCEPT, CURRENT-DATE, DATE, DAY, DISPLAY, EXHIBIT, STOP RUN, ACCEPT, CURRENT-DATE, DATE, DAY, DISPLAY, EXHIBIT, STOP RUN, TRACETRACE

o Any I/O StatementsAny I/O Statements (OPEN, CLOSE, READ, WRITE, REWRITE, DELETE, (OPEN, CLOSE, READ, WRITE, REWRITE, DELETE, START)START)

o REPORT WRITER featureREPORT WRITER feature

o SORT featureSORT feature

CALL statement is allowed if the called program does not issue any CICS CALL statement is allowed if the called program does not issue any CICS commands or inhibited COBOL statements mentioned above.commands or inhibited COBOL statements mentioned above.

Page 16: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

TERMINATION STATEMENTS

    

STOP RUN in COBOL uses operating system facilities, and therefore, is STOP RUN in COBOL uses operating system facilities, and therefore, is discouraged.discouraged.

  

EXIT program is ignored if the program has not been called.EXIT program is ignored if the program has not been called.

  

CICS RETURN COMMAND and/or GOBACK statement is recommended.CICS RETURN COMMAND and/or GOBACK statement is recommended.

Page 17: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

IMPORTANT DEFINITIONS

          TransactionsTransactions

    An exchange between a terminal and a data base representing an application An exchange between a terminal and a data base representing an application process. For example, an inquiry or a deposit and balance update process. For example, an inquiry or a deposit and balance update

          TaskTask

    A specific instance of a transaction i.e. a unique unit of work. A specific instance of a transaction i.e. a unique unit of work.

            ProgramProgram

   Prepared statements compiled or assembled into an executable module of Prepared statements compiled or assembled into an executable module of machine instructions. machine instructions.

Page 18: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

CONVERSATIONAL TRANSACTION

          Program uses a pair of SEND and RECEIVE commands.Program uses a pair of SEND and RECEIVE commands.

            Program waits until the user responds.Program waits until the user responds.

            Resources are held until the user responds.Resources are held until the user responds.

              Very inefficient way of conversing with the user.Very inefficient way of conversing with the user.

Page 19: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

PSEUDO CONVERSATIONAL TRANSACTION

            The task is terminated after a message is sent with a linkage for the next The task is terminated after a message is sent with a linkage for the next task. CICS provides a facility (COMMAREA) to made it easier to accomplish task. CICS provides a facility (COMMAREA) to made it easier to accomplish this.this.

        When the user completes response (by pressing enter) reset task is When the user completes response (by pressing enter) reset task is automatically initiated by CICS.automatically initiated by CICS.

        The task receives the message from the terminal & processes it.The task receives the message from the terminal & processes it.

          This is a multitask operation from system's point of view.This is a multitask operation from system's point of view.   

Page 20: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

PROGRAM PREPARATION

..

Source

DB2Precompiler

CICSTranslator

COBOLCompiler

LinkEdit

LoadModule

Page 21: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

PROGRAM PREPARATION Contd…

              TRANSLATORTRANSLATOR

   - The translator recognizes EXEC CICS and EXEC DLI statements. They are - The translator recognizes EXEC CICS and EXEC DLI statements. They are commented out and replaced with statements in the appropriate language. Here, commented out and replaced with statements in the appropriate language. Here, COBOL MOVE instructions and a CALL are inserted and passed on to the COBOL COBOL MOVE instructions and a CALL are inserted and passed on to the COBOL compiler.compiler.

              DB2 PrecompilerDB2 Precompiler

  

- The DB2 precompiler is supplied by the relational data base managers, DB2 - The DB2 precompiler is supplied by the relational data base managers, DB2 and SQL/DS. It recognizes EXEC SQL statements which it will comment out and and SQL/DS. It recognizes EXEC SQL statements which it will comment out and replace with in our case. COBOL PERFORM and CALL statements.replace with in our case. COBOL PERFORM and CALL statements.

Page 22: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

PROGRAM PREPARATION Contd…

    

      Output of the transaction is i/p to the compilerOutput of the transaction is i/p to the compiler

  

    The o/p of the linkage editor is executable. The load module is placed in the CICS The o/p of the linkage editor is executable. The load module is placed in the CICS online program library.online program library.

  

Messages or warnings are provided on all the listings. The compiler listing is or Messages or warnings are provided on all the listings. The compiler listing is or limited use if the translator listing would not process all commands.limited use if the translator listing would not process all commands.

Page 23: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

TESTING

    

CEMT set program (prg1) New compCEMT set program (prg1) New comp

   OrOr

    CEMT S PR (prg1) NCEMT S PR (prg1) N

        After making changes to a program the new version replaces old version, but After making changes to a program the new version replaces old version, but CICS which is currently executing has no way of knowing this automatically. The CICS which is currently executing has no way of knowing this automatically. The CICS processing program table PPT still points to the old-version.CICS processing program table PPT still points to the old-version.

  

    To avoid testing with the old version, you must use the CICS-provided CEMT To avoid testing with the old version, you must use the CICS-provided CEMT transaction to update the pointer to the program.transaction to update the pointer to the program.

              

Page 24: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

COMMON FORMAT

          A CICS command consists of a keyword phrase, delimiter, function, options A CICS command consists of a keyword phrase, delimiter, function, options and their argument values.and their argument values.

          Be careful about periods. Avoid them after END-EXEC. Be careful about periods. Avoid them after END-EXEC.

    The translator will place a period into the generated code if a period follows The translator will place a period into the generated code if a period follows end-exec.end-exec.

  

EXEC CICS SEND

Keywords Function Option Argument Option Argument

FROM (FLDA) LENGTH (5)END-EXEC

Delimeter

Page 25: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

ARGUMENT VALUES

  data - valuedata - value PIC S9(4) comp PIC S9(4) comp Halfword binaryHalfword binary

IC S9(8) compIC S9(8) comp Fullword binaryFullword binary

PIC X(15) PIC X(15) character string constants permittedcharacter string constants permitted

data - areadata - area COBOL data name COBOL data name

eg :- 01 Record-area.eg :- 01 Record-area.

05 Fld 105 Fld 1

05 Fld 205 Fld 2

namename COBOL data nameCOBOL data name Character stringCharacter string

labellabel Paragraph nameParagraph name

hhmmsshhmmss PIC S9(7) comp 3PIC S9(7) comp 3 Packed decimalPacked decimal

pointer-refpointer-ref BLL cellBLL cell Usage pointerUsage pointer

Page 26: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

RECEIVE COMMAND

            EXEC CICS RECEIVE EXEC CICS RECEIVE

INTO (data area)INTO (data area)

LENGTH(ml)LENGTH(ml)

END-EXECEND-EXEC

   

- RECEIVE command is used to receive incoming data from the terminal to - RECEIVE command is used to receive incoming data from the terminal to which this CICS transaction is associated.which this CICS transaction is associated.

   - A receiving area must be defined in working storage section and has to be - A receiving area must be defined in working storage section and has to be specified in the INTO parameter.specified in the INTO parameter.

   - Length field must be defined in working storage section as a S9(4) comp. It - Length field must be defined in working storage section as a S9(4) comp. It has to be specified in length option.has to be specified in length option.

  

Page 27: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

SEND COMMAND

    

          EXEC CICS SENDEXEC CICS SEND

FROM (data area)FROM (data area)

LENGTH(ln)LENGTH(ln)

END-EXECEND-EXEC

   -The data to be sent must be stored in working storage section, and this field -The data to be sent must be stored in working storage section, and this field name has to be specified in the FROM parameter.name has to be specified in the FROM parameter.

  

- Length must be specified the same as that of the Receive command.- Length must be specified the same as that of the Receive command.

Page 28: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

EXCEPTIONAL CONDITIONS

 

          RESP optionRESP option

    - Define a full word binary field S9(8) comp in the working storage section - Define a full word binary field S9(8) comp in the working storage section as as the response field.the response field.

   - Place RESP option with the response field in any CICS command.- Place RESP option with the response field in any CICS command.

   -After command execution, check the response code in the response field -After command execution, check the response code in the response field with DFHRESP (xxxx) with DFHRESP (xxxx) where xxxx iswhere xxxx is

   -- NORMAL for normal completionNORMAL for normal completion

   OrOr

-- Any exceptional conditionAny exceptional condition

Page 29: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

HANDLE CONDITION

    

      Handle condition command is used to transfer control to the procedure Handle condition command is used to transfer control to the procedure label specified if the exceptional condition, specified occurs.label specified if the exceptional condition, specified occurs.

  

    RRemains active until the end of program or another handle condition emains active until the end of program or another handle condition request overrides it.request overrides it.

  

Page 30: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

IGNORE CONDITION

    

      Ignore condition command causes no action to be taken if the Ignore condition command causes no action to be taken if the condition specified occurs in the programs.condition specified occurs in the programs.

  

Request by the IGNORE CONDITION command is valid until the Request by the IGNORE CONDITION command is valid until the subsequent HANDLE CONDITION command for the same condition.subsequent HANDLE CONDITION command for the same condition.

  

Page 31: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

NO HANDLE OPTION

    

      If NOHANDLE option is specified in any CICS command, no action will be taken If NOHANDLE option is specified in any CICS command, no action will be taken for any exceptional condition occurring during execution of this command.for any exceptional condition occurring during execution of this command.

   Eg : EXEC CICS SENDEg : EXEC CICS SEND

   From (...)From (...)

Length (...)Length (...)

NOHANDLENOHANDLE

END-EXECEND-EXEC

Page 32: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

FORMATTING TIME AND DATE

    

          ASKTIME CommandASKTIME Command

  

- Used to request the current date and time - Used to request the current date and time

  

- EIBDATE and EIBTIME fields have the values at the task initiation time.- EIBDATE and EIBTIME fields have the values at the task initiation time.

             FORMATFORMAT

  

EXEC CICS ASKTIME END-EXECEXEC CICS ASKTIME END-EXEC

Page 33: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

FORMAT TIME COMMAND

  --used to receive the information of data and time in various formats.used to receive the information of data and time in various formats.

   -- FormatFormat

   [YYDDD (data - area)][YYDDD (data - area)]

[YYMMDD (data - area)][YYMMDD (data - area)]

[YYDDMM (data - area)][YYDDMM (data - area)]

[MMDDYY (data - area)][MMDDYY (data - area)]

[DDMMYY (data - area)][DDMMYY (data - area)]

[DATESEP(data - value)][DATESEP(data - value)]

[DAY OF WEEK (data - area)][DAY OF WEEK (data - area)]

[DAY OF MONTH (data - area)][DAY OF MONTH (data - area)]

[MONTH OF YEAR (data - area)][MONTH OF YEAR (data - area)]

[YEAR (data - area)][YEAR (data - area)]

[TIME (data - area)][TIME (data - area)]

[TIMESEP (data - value)][TIMESEP (data - value)]

     

Page 34: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

FORMAT TIME COMMAND Contd…

     - DATESEP represents data separator (default is "/").- DATESEP represents data separator (default is "/").

  

- TIMESEP represents time separator (default is ":").- TIMESEP represents time separator (default is ":").

  

- The data area for the ABSTIME option of ASKTIME and FORMATTIME - The data area for the ABSTIME option of ASKTIME and FORMATTIME commands must be a 15-digit packed decimal data type.commands must be a 15-digit packed decimal data type.

  

Page 35: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

DELAY COMMAND

          DELAY commandDELAY command

  

- used to delay the processing of a task for the specified time interval or until the - used to delay the processing of a task for the specified time interval or until the specified time.specified time.

  

FORMATFORMAT

   EXEC CICS DELAYEXEC CICS DELAY

      INTERVAL (002000) INTERVAL (002000)

          TIME (152000)TIME (152000)

End – EXECEnd – EXEC

   - Task will be suspended for 20 minutes if INTERVAL is specified or until 15:20:00 if - Task will be suspended for 20 minutes if INTERVAL is specified or until 15:20:00 if TIME is specified.TIME is specified.

  

  

Page 36: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

READING EXTERNAL DATA - OBJECTIVE

DIRECT RETRIEVAL

 

- VSAM DATA STRUCTURES

- RELATIONAL TABLE ROW

 

BROWSE

 

- VSAM DATA STRUCTURE

  - RELATIONAL TABLE ROWS

Page 37: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

FUNCTIONAL OVERVIEW

FCT

FILEA

FCP

EIP

EXEC CICSREADFILE C ('FILE')EXEC SQL

PROGRAM

CICSAttachmentFacility

CICSRDB

Database

Page 38: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

FUNCTIONAL OVERVIEW contd…

 Entry for VSAM file has to be there in FCT (File Control Table)

 

     Each entry contains all descriptive information for the file it represents. So, programmer need not define the physical organization and other attributes of the files.

 

- The File parameter coded in the program must be the same as the file name in the FCT.

 

- Interface between CICS and Relational Database is called CICS attachment Facility. Statement are coded in SQL language in the application program to Communicate data requests to the database.

Page 39: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

VSAM DATA STRUCTURES

      CICS uses the following VSAM structuresCICS uses the following VSAM structures

  

- Key sequenced data set (KSDS)- Key sequenced data set (KSDS)

- Entry sequenced dataset (ESDS)- Entry sequenced dataset (ESDS)

- Relative record dataset (RRDS)- Relative record dataset (RRDS)

Sequential Keyed

3 5 9

Key = 5

Record 4

R1 R2 R3

Relative record

Page 40: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

PROGRAM ORGANIZATION

          File attributes are defined in the FCT for each fileFile attributes are defined in the FCT for each file

      Files are opened by CICSFiles are opened by CICS

   -- Immediately after system initialization if specified in the FCT.Immediately after system initialization if specified in the FCT.

-- In response to a file access request from an application if the file is closedIn response to a file access request from an application if the file is closed

-- In response to a master terminal CEMT request from an operation.In response to a master terminal CEMT request from an operation.

  Application program is not responsible for open / close of filesApplication program is not responsible for open / close of files

Record layout Definition

Record key filed

Linkage section

Working Storage

EIB

Procedure Division

ID entry key of record to be read

EXEC CICS Read file....

Page 41: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

RECORD IDENTIFICATION

    RECORD KEY

    RELATIVE BYTE ADDRESS

     RELATIVE RECORD NUMBER

     PARTIAL KEY

  - key of the record to be read is specified in the RIDFLD.

for KSDS

  - Key specified can be a full key or partial key

  - If partial key, key length has to be provided

  - RBA (Relative Byte Address)

  - Can also be used instead of actual key value

     For ESDS

- RIDFLD contain a 4 byte RBA

     For RRDS

- RIDFLD contains 4 Byte binary relative record number.

Page 42: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

READ COMMAND

     READ command with INTO Option. (FULL KEY)

  - Reads the record specified by the full key.

- The data content of the record is moved into the specified data-area defined in the working storage section.

  FORMAT

  EXEC CICS READ

DATASET (name) | FILE (name)

INTO (data-area) | SET(ptr-ref)

RIDFLD (data-area)

[ LENGTH (data-values) ]

END - EXEC.

 - DATASET / FILE names the file and must be defined in FCT.

- INTO names the field in the working storage section where the data has to be placed.

- RIDFLD is the key field.

- LENGTH is half word binary. It indicates maximum length of the record to be read. It is optional.

Page 43: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

EXCEPTIONAL CONDITIONS

  DUPKEY : If duplicate record is found for the specified key.

 

NOTFND : If the record is not found for the key specified.

 

LENGERR : The specified length (in LENGTH OPTION) is shorter than the actual record length.

  NOTOPEN : When file specified is not open.

 

Page 44: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

READ

      READ command with GENERIC OPTION

  Used to read a nonspecific record based on the generic key. (i.e. higher part of key) specified, instead of full key.

  EXEC CICS READ

FILE (‘FILEAAA’)

INTO (FILE-IOAREA)

RIDFLD (REC-KEY)

KEYLENGTH (3)

GENERIC

LENGTH (WS-LEN)

END-EXEC

- KEY LENGTH specifies length of Generic key.

Page 45: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

EXAMPLE

  MOVE 50 TO WS - LEN

MOVE ‘BAG’ TO REC - KEY.

  EXEC CICS READ

DATASET (‘FILEAAA’)

INTO (data-area)

RIDFLD (REC-KEY)

KEYLENGTH (3)

GENERIC

LENGTH (WS-LEN)

END-EXEC.

 DATA IN FILE

  ARG 112

ARG 111

BAG 110 This record will be read as this is the first record with key BAG

BAG 112

TRG 111

 

EXCEPTIONAL condition :

  INVREQ: Key length specified is greater than the actual key length of the record

Page 46: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

READ COMMAND

     READ command with GTEQ option

 

- Used to read a non-specific record whose key is equal to or greater than the full key data specified.

 

EXEC CICS READ

FILE (‘FILEAAA’)

INTO (data-area)

RIDFLD (REC-KEY)

GTEQ <---- Greater than or equal to search

LENGTH (WS-LEN)

END - EXEC.

Page 47: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

BROWSE

     BROWSE

 

- VSAM FILE RECORDS

- Establish position

- Retrieve and process records

- Terminate browse

    Record retrieved as a part of browse cannot be

updated during browse.

Page 48: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

STARTBR

    STARTBR COMMAND - to establish starting position for a file

  EXEC CICS STARTBR

FILE (name)

RIDFLD (data-area)

GTEQ

END-EXEC.

  GTEQ If no record is found for exact key, CICS places position to next available

record

  EQUAL If no record is found for the exact key, exceptional condition NOTFND

occurs

GENERIC Places the position at the first record of partial key

 Exceptional conditions.

      DSIDERR : File specified is not found in FCT.

  NOTFND : Specified Record is not found

Page 49: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

READNEXT

     READNEXT command - Ued to read a record of a file sequentially forward

  - STARTBR must be successfully completed before READNEXT

command

  EXEC CICS READNEXT

FILE (name) | DATASET(name)

INTO (data_area)

LENGTH (data_value)

RIDFLD (data_area)

END-EXEC.

 Exceptional Conditions –

DUPKEY : If Duplicate record is found for key specified.

 ENDFILE : End of file detected.

LENGERR: Actual record length greater than the length specified

Page 50: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

READPREV

READPREV command

  - Used to read a record of a file sequentially backward

  - STARTBR must have been successfully completed before READPREV command

 

Options and parameters are same as READNEXT command

 

Exceptional Conditions

  NOTFND: If no record is found for key specified

  INVREQ: Generic option must not be used in the STARTBR command prior to READPREV command if used, this condition occur.

Page 51: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

XCTL COMMAND

EXEC CICS XCTL EXEC CICS XCTL

PROGRAM (PROGRAM NAME)PROGRAM (PROGRAM NAME)

RESP (EXCEPTION)RESP (EXCEPTION)

END-EXEC.END-EXEC.

  

IF EXCEPTION = DFHRESP (PGMIDERR)IF EXCEPTION = DFHRESP (PGMIDERR)

  

-- A module given control through the use of a CICS XCTL command will not A module given control through the use of a CICS XCTL command will not return to the program that issued the XCTL.return to the program that issued the XCTL.

  

-- The required program name is character string constant (max 8 The required program name is character string constant (max 8 characters)characters)

  

- The PGMIDERR exception condition occurs when the name is not in the The PGMIDERR exception condition occurs when the name is not in the PPT.PPT.

Page 52: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

PROGRAMS TO PROGRAM TRANSITION

      CICS LINKCICS LINK

  

          CICS XCTLCICS XCTL

  

          COBOL CALLCOBOL CALL

  

          Alternative to XCTL or LINK Alternative to XCTL or LINK COBOL CALL COBOL CALL

  

          COBOL CALL passes control to other programs.COBOL CALL passes control to other programs.

  

Page 53: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

ADDRESSABILITY

          DFHCOMMAREA & DFHEIBLK :DFHCOMMAREA & DFHEIBLK :

Addressable automatically by CICSAddressable automatically by CICS

  

          Dynamically acquired storage :Dynamically acquired storage :

Addressable by programAddressable by program

  

        Not necessary to always do a EXEC Not necessary to always do a EXEC

CICS GETMAIN explicitlyCICS GETMAIN explicitly

  

Page 54: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

CICS QUEUEING FACILITIES

          

Page 55: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

CICS QUEUEING FACILITIES

          Two facilities to store data that are temporary in nature.Two facilities to store data that are temporary in nature.

  

          This data is created or collected by one or more online transaction to be This data is created or collected by one or more online transaction to be used later by the same transaction or by a different transaction or even later used later by the same transaction or by a different transaction or even later passed to a batch program.passed to a batch program.

  They areThey are

              Transient data Queue (TDQ)Transient data Queue (TDQ)

  

          Temporary storage Queue (TSQ).Temporary storage Queue (TSQ).

  

Page 56: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

TRANSIENT DATA QUEUE

          They are identified by a 4 character ID called destination IDThey are identified by a 4 character ID called destination ID

  

          Destination ID and other characteristics of TDQ are defined in the destination control table (DCT) Destination ID and other characteristics of TDQ are defined in the destination control table (DCT) by the system programmer.by the system programmer.

  

          2 types of TDQ’s 2 types of TDQ’s

  

-- Intra Partition TDQIntra Partition TDQ

  

-- Extra Partition TDQExtra Partition TDQ   

  

Page 57: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

TRANSIENT DATA QUEUE - Contd…

Intra Partition TDQIntra Partition TDQ - Processed only within the same CICS region- Processed only within the same CICS region

  

Extra Partition TDQExtra Partition TDQ - Individual Sequential Files processed between - Individual Sequential Files processed between the transaction of the CICS region and the system outside of the cics regionthe transaction of the CICS region and the system outside of the cics region

Page 58: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

INTRA PARTITION TDQ

  

          All Intra partition TDQ are stored in only 1 physical file (VSAM)All Intra partition TDQ are stored in only 1 physical file (VSAM)

  

          Record from the queue can be returned sequentially.Record from the queue can be returned sequentially.

  

          Record can be written sequentially.Record can be written sequentially.

  

          Records can be of variable length formatRecords can be of variable length format

  

          Several tasks can write to the same TDQ but only one task can read from Several tasks can write to the same TDQ but only one task can read from TDQ.TDQ.

Page 59: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

EXTRA PARTITION TDQ

        Extra partition TDQ is a separate physical file & may be a disk, tape or Extra partition TDQ is a separate physical file & may be a disk, tape or reporter.reporter.

          DCT determines the initial open / close status of a file while the file can DCT determines the initial open / close status of a file while the file can be opened or closed through the master terminal transaction during CICS be opened or closed through the master terminal transaction during CICS session.session.

        TDQ can be defined as an Input or output but not both.TDQ can be defined as an Input or output but not both.

            Records are fixed, variable, blocked or unblocked.Records are fixed, variable, blocked or unblocked.

          

Page 60: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

CICS COMMANDS FOR TDQS

EXEC CICSEXEC CICS

WRITEQ TD QUEUE (NAME)WRITEQ TD QUEUE (NAME)

FROM (DATA-AREA)FROM (DATA-AREA)

[LENGTH (DATA-VALUE)][LENGTH (DATA-VALUE)]

END-EXEC.END-EXEC.

  EXEC CICSEXEC CICS

READQ TD QUEUE (NAME)READQ TD QUEUE (NAME)

INTO (DATA-VALUE)INTO (DATA-VALUE)

[LENGTH (DATA-VALUE)][LENGTH (DATA-VALUE)]

END-EXEC.END-EXEC.

  EXEC CICS DELETEQ TDEXEC CICS DELETEQ TD

QUEUE (NAME)QUEUE (NAME)

END-EXEC.END-EXEC.

Page 61: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

EXCEPTIONAL CONDITIONS

Exception Conditions  Exception Conditions  

LENGERR - length specified is greater than the maximum record length LENGERR - length specified is greater than the maximum record length specified in DCTspecified in DCT

    Qzero - Destination empties or end of TDQQzero - Destination empties or end of TDQ

Qlderr - The dest ld specified cannot be found n DCT.Qlderr - The dest ld specified cannot be found n DCT.

  

Page 62: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

TEMPORARY STORAGE QUEUE

      TSQ is a queue of stored records.TSQ is a queue of stored records.

    Created & deleted dynamically by application program.Created & deleted dynamically by application program.

        Used as a scratch padUsed as a scratch pad

        Queue ID is of length 1-8 bytesQueue ID is of length 1-8 bytes

        TSQ is of variable lengthTSQ is of variable length

        Records can be stored in main or auxiliary storageRecords can be stored in main or auxiliary storage

        The records once written remains accessible until the entire TSQ is deletedThe records once written remains accessible until the entire TSQ is deleted

          Records can be read sequentially or directlyRecords can be read sequentially or directly

          Records can be re-read & updated.Records can be re-read & updated.

  

Page 63: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

WRITEQ TS

To write or re-write a record in TSQTo write or re-write a record in TSQ

   EXEC CICS WRITEQ TS EXEC CICS WRITEQ TS

QUEUE (NAME)QUEUE (NAME)

LENGTH (DATA-VALUE)LENGTH (DATA-VALUE)

[ITEM (DATA-AREA).[ITEM (DATA-AREA).

[REWRITE][REWRITE]

[MAIN | AUXILIARY][MAIN | AUXILIARY]

END-EXEC.END-EXEC.

  ITEM - If this option is coded CICS write return the item number ITEM - If this option is coded CICS write return the item number

assigned to the record just written.assigned to the record just written.

  REWRITE - is used to rewrite the record identified by ITEM.REWRITE - is used to rewrite the record identified by ITEM.

  Main / Auxiliary - To specify the storage medium. Will be stored in Main / Auxiliary - To specify the storage medium. Will be stored in

main if auxiliary storage not supported.main if auxiliary storage not supported.

  

Page 64: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

READQ TS

Can be used to read records either sequentially or directly.Can be used to read records either sequentially or directly.

   EXEC CICS READQ TS EXEC CICS READQ TS

QUEUE (NAME)QUEUE (NAME)

INTO (DATA - AREA)INTO (DATA - AREA)

LENGTH (DATA-VALUE)LENGTH (DATA-VALUE)

[ITEM (DATA-VALUE) | NEXT][ITEM (DATA-VALUE) | NEXT]

[NUMREC (DATA-AREA)][NUMREC (DATA-AREA)]

END-EXEC.END-EXEC.

NEXT - to retrieve the next - logical record in the TSQ.NEXT - to retrieve the next - logical record in the TSQ.

NUMREC - the data area is defined as PIC 9(4) comp. to find the Total no. of NUMREC - the data area is defined as PIC 9(4) comp. to find the Total no. of records in the TSQ.records in the TSQ.

  Item - for direct access specify the item no of the record.Item - for direct access specify the item no of the record.

  

Page 65: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

DELETEQ TS of TSQ

EXEC CICSEXEC CICS

DELETEQ TS DELETEQ TS

QUEUE (NAME)QUEUE (NAME)

END-EXEC.END-EXEC.

  

          AAll records is TSQ are deleted.ll records is TSQ are deleted.

  

          AAll associated storage is released.ll associated storage is released.

Page 66: IBM Global Services © Copyright IBM Corporation 2004 | INTRODUCTION TO CICS Pavani D Feb 23, 2007.

|

IBM Global Services

© Copyright IBM Corporation 2004

EXCEPTIONAL CONDITIONS

Exception Conditions  Exception Conditions  

Itemerr - Item number specified is not in the range of entry number Itemerr - Item number specified is not in the range of entry number assigned for the Queue.assigned for the Queue.

    Lengerr - Length specified is greater than the maximum record length.Lengerr - Length specified is greater than the maximum record length.

Qiderr - specified is Queue id not found.Qiderr - specified is Queue id not found.


Recommended