cics v1.0

Upload: krishifet

Post on 04-Jun-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 CICS V1.0

    1/35

    Mainframe Refresher Part-1 CICS-Page:1

    CICS (Customer Information Control System)

    History

    IBM launched the initial ersion of CICS in 1!"#$It is a %ata&ase'%ata Communication Control System here an alication rogram

    can concentrate on the alication rocessing ithout orrying a&out *S+ hardare

    and others$ Initially CICS as on macro leel and later ugraded to command leel$

    ,his &oo is ritten &ased on CICS'M.S ./R0

    ,as and ,ransaction

    ,as is a unit of or and transaction is an entity that initiates the eecution

    of tas$ ,he transaction identifier identifies the transaction in CICS$

    Conersation and Pseudo conersation

    Program can communicate ith user &y a air of S23% and R2C2I.2commands$ But in &eteen the S23% and R2C2I.2+ that is during the human

    resonse time+ all the resources are held &y the rogram$*nce the user entered the information in the screen+ the rogram roceeds

    further$ ,his mode of communication is called Conersational mode$ It is un-famousfor the resource astage$

    In Pseudo conersation mode+ heneer there is a need for conersation ith

    user+ the rogram logically terminates there+ releases the resources held &y it andass control information to net transaction and the net transaction is automatically

    started once user entered the information in the screen$It is actually multi tas oeration &ut loos lie conersation from user oint

    of ie$

    4or easy understanding e ould say the communication in telehone line isconersational mode (,elehone line is in usage through out the communication$)

    IRC as Pseudo conersation (*nce the message sent+ the line is freed and it againgets the resources hen the other side relied$)

    Multitasing and Multithreading

    *erating system allos eecution of more than one tas concurrently andthis is called multitasing$ If the one or more concurrent tass use the same coy of

    the rogram+ then this is called multithreading$ So it is o&ious that multitasing is a

    su&set of multithreading$

    Reentrant and 5uasi-reentrantIf the same coy of the rogram is used &y multile tass+ then the system

    should tae care of the roer reentrance after the S.C'CICS interrution$

    Reentrant rogram is defined as a rogram that does not modify itself so thatit can reenter to itself and continue rocessing after an interrution &y the S.C callof *S$ Batch rograms are non-reentrant$ Reentrancy under CICS enironment is

    called 6uasi entrant as the interrution in CICS may inole more than one S.C callsor no S.C at all$

    C*B*7 rograms should &e comiled ith R23, otion for reentrancy in

    multithreading enironment$

  • 8/13/2019 CICS V1.0

    2/35

    Mainframe Refresher Part-1 CICS-Page:/

    CICS Control Program and Control ,a&les

    CICS 3ucleus consists of IBM-Sulied CICS control rograms andcorresonding user-secified CICS control ta&les$ ,he imortant ta&les ith resect

    to deeloer oint of ie are gien &elo:

    Control

    ,a&le

    4unction

    PC, ,he transactions and the main rogram associates ith the transactionshould &e registered in Program ta&le$ ,as control Program (8CP)

    refers PC,$

    PP, 9ll the CICS rograms and Mas hae to &e registered in ProcessingProgram ,a&le$ Program Control Program (PCP) refers PP,$

    4C, 9ll the .S9M files used in the CICS rograms has to &e registered in

    4ile Control ,a&le$ 4ile Control Program (4CP) refers 4C,$

    %C, ,ransient data 6ueues should &e redefined in %estination Control

    ,a&le$ ,ransient %ata Program refers %C,$

    ,S, If you ant to recoer ,emorary storage 6ueues during system

    crash+ then they should &e registered in ,emorary Storage ,a&le$

    RC, If any %B/ commands are used in the rogram+ then the P793 should&e registered here$

    S3, ser I% and Passord should &e registered in Sign-*n-,a&le$

    ,C, 9ll the terminals should &e registered in ,erminal Control ,a&le$

    P7, 9ll the rograms that need to &e automatically started during CICS

    start u and Shut don should &e listed in Program 7ist ,a&le$

    ;C, Control information of system logs and e CICS commands$ So all the CICS

    commands are coded ithin 2?2C CICS and 23%-2?2C scoe$ ,he rogram is firstassed to CICS ,ranslator and the translator ill conert all the CICS commands to

    C*B*7 call statements and this modified source is assed to C*B*7 comiler$

    If your Program has %B/ commands then the se6uence of rearing load

    module ould &e %B/ Pre-comiler+ CICS ,ranslator+ C*B*7 Comiler and 7ineditor$ 7ogically seaing the order of %B/ recomiler and CICS translator can &e

    reersed also$ But as a conention e are first doing recomilation$

    If translation is done first+ CICS translator tries to recogni>e to %B/

    statements and ould issue diagnostic messages$ ,he other reason is+ most of therograms do lot of %B/ oerations than CICS oerations$ So if you do re-

    comilation first+ all the %B/ statements are conerted into C*B*7 call statements infirst hase itself and the translation time ould &e less$

    C*B*7-CICS rograms should &e comiled ith R23, R2SI%23, 3*%@39M

    and 7IB otions$

    Aeneral Synta of CICS statement2?2C CICS function

    (otion (argument alue)(otion (argument alue)

    23%-2?2C$

  • 8/13/2019 CICS V1.0

    3/35

    Mainframe Refresher Part-1 CICS-Page:0

    Restricted C*B*7 commands in CICS enironment

    *S S.C ,riggering statements 9CC2P, CRR23,-%9,2 %9,2 %9@ %ISP79@

    I'* statements *P23 C7*S2 R29% DRI,2 R2DRI,2 %272,2

    S,9R,

    S*R, statement R2,R3 R2729S2

    .S C*B*7 / allos S,*P R3 and that returns control &ac to CICS$

    M9P %2SIA3

    Before get into rogram design+ let us see ho mas (screens) are designedin CICS$ Most of the installations use tools lie S%4 for screen designing$ ,he tools

    generate BMS macros for the designed screen$ De &rief the BMS macros inoled inthe ma design$ BMS is acronym for Basic Maing Suort$

    M9P and M9PS2,

    9 screen designed thru BMS is called M9P$ *ne or a grou of mas maes u

    a M9PS2,$

    PH@SIC97 M9P 93% S@MB*7IC M9PPhysical mas control the screen alignment+ sending and receiing of

    C*3S,93,S and data to and from a terminal$ ,hey are coded using BMS macros+

    assem&led and lin edited into CICS 7*9% 7IBR9R@$ ,hey ensure the deiceindeendence in alication rograms$

    Sym&olic mas define the ma fields used to store the .9RI9B72 data

    referenced in C*B*7 rogram$ ,hey are also coded used BMS Macros$ But afterassem&ling+ they are laced in a C*P@ li&rary and then coied into CICS rograms

    using C*P@ statement$ ,hey ensure deice and format indeendence to thealication rograms$

    BMS Macro Coding Sheet

    Since BMS ma definitions are urely assem&ler macros+ the folloing coding

    conention must me maintained$

    1 1E 1" F/

    (1-#) 7a&el (1E-1G) Macro name (1"-F1) *erands F/-Continuation$

    Macro name$ ,here are three macros used in BMS coding$1$ %4HMS%$ %efining Maset

    /$ %HM%I$ %efining Mas0$ %4HM%4$ %efining 4ields$

    9ll the BMS coding starts ith %4HMS% folloed &y one or more %4HM%I$

    *ne or more %4HM%4 follo %4HM%I$

    7a&el: 7a&el is name of the oeration$ If the macro is %4HMS%+ it secifies

    ma-set name$ If the macro is %4HM%4 then it secifies field name$*erands: %efine the arameters for the macro &eing inoed$

    Continuation: Continuation of macro is achieed &y ? in F/ndcolumn of thecurrent line and continues from the 1"thcolumn of net line$

  • 8/13/2019 CICS V1.0

    4/35

    Mainframe Refresher Part-1 CICS-Page:J

    Comments: Comment lines are indicated &y K in column 1$ 9 comment line

    cannot &e laced &eteen continuation lines and comment lines cannot &e continued$Blan lines: @ou cannot hae &lan lines in the assem&ler rogram$

    %4HMS%

    It is used to define a maset ith its characteristic and to end a maset$ So

    you ill find to %4HMS% in any BMS coding$ ,he imortant oerands are &elo:

    ,@P2$

    It should &e %S2C, for Sym&olic ma generation+ M9P for hysical mageneration and 4I397 to indicate the end of maset$ 9lternatiely sym&olic

    arameter LS@SP9RM can &e coded in the ,@P2 of defining %4HMS% and the alue

    can &e oerridden in the P9RM arameter of assem&ly rocedure$ ,his aoids thechange in the BMS coding$

    M*%2$I3 for inut mas lie order entry screens and *, for outut mas lie

    dislay screens and I3*, for inut-outut mas lie udate screens$

    793A$It secifies the language in hich the sym&olic ma is to &e generated$ It can

    &e C*B*7+ P7I+ 9SM or RPA$

    S,*R9A2$9,* is used to ac6uire searate sym&olic ma area for each maset$

    B9S2M9P-I*9R29 allos multile mas from more than one maset to sharesame storage area$ M9P-I*9R29 ill &e redefined multile times to achiee it$

    ,I*9P4?$

    It should &e @2S to resere the refi sace of 1/ &ytes for BMS commandsto access ,I*9 roerly$ ,his is re6uired for command leel CICS$

    C,R7$

    %eice control re6uests are laced here$ Multile arameters are searated &ycomma$ 4R228B is used to unloc the ey&oard$ 4RS2, is used to reset the M%, of

    all the fields in all the mas to >ero$ 979RM is used to set an alarm at screen dislaytime$ PRI3, is used to send the maset to rinter$

    ,2RM$If anything other than 0/FE terminal is used for dislay of screens+ then it

    should &e coded here$ ,his ensures deice indeendence &y means of roiding thesuffi$ S44I? is used to secify suffi for the terminal and it should corresond to

    ,C, entry of the terminal$

    %4HM%IIt is used to define a ma ith its characteristic in a maset$ ,here can &e

    any num&er of %4HM%I$ Some of the imortant oerands of %4HM%I are &elo:

    SIN2$ It has to arguments namely length and &readth and as a hole thesi>e of the ma is secified here$

    7I32$ ,he ma starting line is mentioned here$C*7M3$ ,he ma-starting column ithin the 7I32 is mentioned here$

    ;S,$ RIAH, or 724, is coded here to inform the

  • 8/13/2019 CICS V1.0

    5/35

    Mainframe Refresher Part-1 CICS-Page:G

    ,he a&oe four arameters decides the si>e and location of ma ithin ma

    set$ C,R7 and ,I*9P4? can &e also coded in %4HM%I$ .alue of %4HM%I oerrides thealue of %4HMS%$

    %4HM%4

    It is used to define a field ith its characteristic in a ma$ ,here can &e any

    num&er of %4HM%4 ithin %4HM%I$ Some of the imortant oerands of %4HM%4 are&elo:

    P*S$It has to arguments that decided the osition of the field$ ,he to

    arguments are line and column$ It is the osition here the attri&ute &yte of the field

    starts$

    723A,H$

    ,he length of the field is coded here$ It ecludes the attri&ute character$

    9,,RIB$9ll the inut and outut fields are refied &y one &yte attri&ute field that defines

    the attri&utes of the field$ Some of the attri&utes are:1$ 9S8IP'PR*,'3PR*, Mutually eclusie arameters that define the

    tye of the field$ 3PR*, is coded for inut and inut-outut fields$ PR*, iscoded for outut and stoer fields$ 9S8IP is coded for screen literals and

    sier fields$ ,he cursor automatically sied to net field and so youcannot enter data into sier field$

    /$ 3M$ E-!+Period and = are the only alloed characters$0$ BR,'3*RM'%R8 Mutually eclusie arameters that define the

    intensity of the field$J$ IC Insert Cursor$ Cursor ill &e ositioned on dislay

    of ma$ If IC is secified in more than one field of a ma+ the cursor ill &elaced in the last field$

    G$ 4S2, Indeendent of hether the field is modified ornot+ it ill &e assed to the rogram$ M%, is set for the field$

    ;S,I4@$

    RIAH, is the default alue$ Code 724, for numeric fields$

    PICI3 and PIC*,$

    It defines the Picture clause of the sym&olic ma in C*B*7 and useful fornumeric field editing$

    I3I,I97$

    ,he default alue of the field is coded here$ Dhen the M9P is sent+ this alue

    ill aear in the field$ ,he constant information lie ,I,72 is coded using I3I,I97

    eyord of field definition$ ,o aoid data traffic+ these constant information fieldsshould not &e coded ithout 79B27 arameter$ If there is no 79B27 arameter+ thensym&olic ma ill not generated for those fields as they are unnamed fields$

  • 8/13/2019 CICS V1.0

    6/35

    Mainframe Refresher Part-1 CICS-Page:"

    Ho a field loos lie in a Sym&olic ma

    7et the la&el of one %4HM%4 is 2MP39M2 in the ma 2MP%2, and the length

    of it is /E$ ,he resectie sym&olic ma ould loo lie follos$

    E1 2MP%2,I$

    E/ 4I772R PIC ?(1/) ,I*9P4? @2S creates this 1/ &yte filler$ E/ 2MP39M2LPIC S!(EJ) C*MP$ 7ength 4ield

    E/ 2MP39M2FPIC ?$ 4lag &yte

    E/ 4I772R R2%24I32S 2MP39M24$E0 2MP39M2A PIC ?$ 9ttri&ute &yte

    E/ 2MP39M2I PIC ?(/E)$ 9ctual field (Inut)

    *ther fieldsO$E1 2MP%2,*O R2%24I32S 2MP%2,I$

    E/ 4I772R PIC ?(1/) ,I*9P4? @2S creates this 1/ &yte filler$ E/ 4I772R PIC ?(E0)

    E/ 2MP39M2O PIC ?(/E)$ 9ctual field (*utut)*ther fieldsO

    So four fields are generated for eery named field in the BMS$

    4ieldname7It has length of the field entered &y the user during the inut oeration$

    4ieldnameIIt is the actual inut field that carries the entered information$ ,he alue of

    this field is ?EE if no data is entered$ ,he sace corresonds to ?JE$4ieldname9

    It is attri&ute &yte$ It defines the attri&utes of the field$4ieldname4

    It is a flag &yte$ It has ?EE &y default$ It ill &e set to ?#E if the usermodifies the field &ut no data is sent$ ,hat is hen the user ressed clear ey oer

    the field$4ieldname*

    ,his field should &e oulated in the rogram &efore sending the screen todislay$

    Please note that the ords I3P, (R2C2I.2) and *,P, (S23%) are ith resect to

    rogram$

    More on 9ttri&ute fieldDe hae

  • 8/13/2019 CICS V1.0

    7/35

    Mainframe Refresher Part-1 CICS-Page:F

    Modified %ata ,ag(M%,)

    M%, is one &it field of the attri&ute &yte$ ,he rogram can receie only the

    fields ith M%, 1 on R2C2I.2$ 2ffectie use of M%, can reduce the data trafficdrastically in the communication line$

    M%, can &e S2,'R2S2, in the folloing ays$

    1$ Dhen the user modifies the field+ the M%, of the field is automatically set

    to *3$/$ C,R74RS2, of %4HMS% or %4HM%I ill R2S2, the M%, to *44 for all

    the fields in the maset or ma$ 4S2, eyord of the attri&ute oerand

    definition of %4HM%4 ill set the M%, to *3 $ It oerrides the 4RS2,definition for the secific field$

    0$ Before sending the screen+ &y oerriding the M%, &it of attri&ute &yte offield the M%, can &e set to *3$

    If you are secific on the alues of some fields indeendent of hether the

    user has modified or not+ code them ith 4S2,$ *ne good eamle is default aluesfor the inut fields (lie *rder receied date)$ If the user finds default alue (current

    date) in the screen and it is fine ith his re6uirement+ then he ont touch the fieldand M%, ill not &e set$ ,he rogram cannot receie the field as M%, is *44$

    But actually the rogram needs this field$ So this field should hae &een defined ith4S2,$

    CRS*R Positioning

    Positioning of cursor is an imortant area in screen design$ By default+ thecursor ill &e laced in the first unrotected field$

    Static Positioning$

    If IC is coded in the attri&ute oerand of %4HM%4 macro+ then the cursor ill&e laced in that field$ If IC is coded in more than one field+ then last field ith IC

    ill get the cursor$

    Sym&olic Positioning$

    Moe =1 to length of the field here you ant lace the cursor and send thema ith CRS*R otion$ ,his is deice indeendent method and recommended to

    control the cursor osition dynamically$

    Relatie Positioning$

    Send the ma ith CRS*R(alue) otion$ ,his ill set the cursor at the

    osition coded &y alue+ relatie to the first column of the screen$ ,his is deicedeendant method of dynamic cursor ositioning and not recommended$ Dhen thereis change in screen layout+ the rogram needs to &e modified$

    CRS*R(0E) ill lace the cursor in the 0Eth column$ (4irst line first column isN2R*)$

    Cursor Position$

  • 8/13/2019 CICS V1.0

    8/35

  • 8/13/2019 CICS V1.0

    9/35

    Mainframe Refresher Part-1 CICS-Page:!

    ation ,a&le (SI,)$ sually there ill &e a maing

    for P4F and P4# ith age u and age don commands resectiely$ PRA2

    M2SS9A2 is used to urge the message that is accumulated &ut not yet send$

    4ormat of H29%2R and ,R9I72RIf ,2?,-H29%2R is the aria&le used in H29%2R command and the header is

    *R%2R I3.23,*R@ =Page nn- + then the aria&le ,2?,-H29%2R should &e defined

    as follos in oring-storage section$

    E1 ,2?,-H29%2R$ EG 4I772R PIC S!(J) C*MP .972 /F$ Q 7ength of the tet$

    EG 4I772R PIC ? .972 L$ Q Character identifying automatic age num&er in the tet$

    EG 4I772R PIC ?$ Q *ne &yte control field used &y BMS$

    EG 4I772R PIC ?(/F) .972 *R%2R I3.23,*R@ = Page LL - $

  • 8/13/2019 CICS V1.0

    10/35

    Mainframe Refresher Part-1 CICS-Page:1E

    Q 9ctual tet in the header$

    ,R9I72R also can &e coded in the same ay$ 9utomatic- age-num&er-

    identifying character ill &e saces for ,R9I72R oring storage aria&le$9CCM and P9AI3A can &e also used ith S23%-M9P and the meaning is

    same$

    S23%-C*3,R*7Dhen the M9P is sent+ e can secify deice control otions lie 4R228B

    979RM 2R9S2+ along ith S23%-M9P$ If one ants to issue the deice controlotions &efore sending the ma+ S23% C*3,R*7 ill &e useful$ It is used to

    esta&lish the deice control otions dynamically$

    Synta:2?2C CICS S23% C*3,R*7

    CRS*R(data-alue) 2R9S2 2R9S2P 4R228B 979RM 4RS2,

    23%-2?2C

    PRI3, ,hrough BMSPRI3, otion of S23% M9P command allos the reorts to &e rinted at the

    local rinter connected to the terminal$ In this case+ M9P is sent to the rinter andnot to the terminal$

    Synta:2?2C CICS S23% M9P(M9P-39M2)

    M9PS2,(M9PS2,-39M2) PRI3,

    372*M23%-2?2C$

    372*M otion is recommended ith PRI3, otion$ Dhen this otion is used+1$ BMS &uilds the data stream using ne line characters and &lan characters to

    osition the fields on the rinter age$/$ ,he data stream is terminated &y 2*M (end of message) that stos rinting$

    So rinter &uffer is efficiently used+ allos larger ages to &e rinted from thesame &uffer that maes the rinting faster$

    Message Routing

    9 message can &e routed to one or more terminals other than the directterminal ith hich the rogram has &een communicating$ ,he message eligi&le for

    message routing is+ a message constructed &y the S23% M9P command ith the

    9CCM otion$R*,2 command esta&lishes the message routing enironment and the S23%

    P9A2 command issued after R*,2 command sends the message to the destination$Synta:

    2?2C CICS R*,2 7IS,(data-area)+ *PC79SS(data-area)+

    I3,2R.97(hhmmss),IM2(hhmmss)+

    ,I,72(data-area)+ 2RR,2RM(name)23%-2?2C$

    7IS, and *PC79SS name the route list and oerator class codes resectiely$

    I3,2R.97 ' ,IM2 determines the actual timing of message deliery in the timeinteral or the time resectiely$

    ,I,72 names the title field defined in the oring storage section and2RR,2RM secify the terminal I% here the error message (if any) to &e sent$

    Route list is reared in oring storage using the folloing conention$

  • 8/13/2019 CICS V1.0

    11/35

    Mainframe Refresher Part-1 CICS-Page:11

    ,,,,rr***srrrrrr = # &ytes named r are declared as saces$ ,,,, names the

    terminal identifier as in ,C, and *** secify the oerator id as in S3,$ s is statusflag$ Code as many 1" &ytes fields as the destinations and indicate end of route list

    is ith the declaration of half ord &inary field ith =1 alue$,he message can &e routed to eery terminal at hich users of the secified

    oerator class is signed on$ ,his is done using *PC79SS$

    Program %esign

    Pseudo logic in CICS rograms is achieed in three ays$

    1$Multile Programs and Multile ,ransaction Ids$,he conersation rogram is logically and hysically diided into multile

    rograms and each rogram is registered ith one transaction I%$ 2ach rogram

    issues R2,R3 command ith net transaction I%$ So after the screen is sent+ thefirst rogram ill &e terminated$ *nce the user filled u the information in screen

    and ress 23,2R+ the net rogram of the net transaction I% (returned &y the firstrogram) gets control and the same rocess is folloed for n rograms$

    9dantage: 2asy deeloment and maintenance$%isadantage: Possi&le Code redundancy and num&er of PC, and PP, entries$

    /$Multile ,ransactions and single rogram$

    4irst aragrah of the rocedure diision controls the flo the differentsections of the rogram &ased on the transaction identifier stored in 2IB,R3I%$

    2ery section ends ith R2,R3 command ith net transaction to &e inoed oncomletion of the screen information &y the user$

    ,hus the conersational rogram is logically diided than hysical diision$9dantage: PP, entries are less comared to case 1$

    %isadantage: 3um&er of PC, entries are still the same as case 1$

    0$*ne transaction and *ne rogram$ (Preferred ay)R2,R3 command has an otional arameter of C*MM9R29 and 723A,H$

    sing this arameter e can ass information &eteen the transactions$So first aragrah of your rogram ill chec hether this is the first entry or

    nth entry$ If 2IBC9723 is >ero+ this is first entry$ So diert the rogram to thesection that ill do all initial rocessing and thro the first screen for the user$

    In addition to this it udates C*MM9R29 ith some control information lie

    internal transaction identifier$ ,his C*MM9R29 is assed along ith R2,R3,R93SI%$ So 2IBC9723 is udated ith 723A,H of C*MM9R29$ ,he second and nth

    entrances dont hae 2IBC9723 as >ero and so &ased on the information in theC*MM9R29+ transfer the control to different sections of the rogram$

    ,as Initiation Process

    1$ser entered transaction identifier$/$,erminal Control Program along ith ,erminal Control ,a&le recogni>es the

    incoming data from the terminal$

    0$Storage Control Program ac6uires the storage for the terminal inut oututarea (,I*9)

    J$,erminal Control Program laces the data from the terminal into ,I*9 andsets the ointer into ,C, entry of the terminal$

  • 8/13/2019 CICS V1.0

    12/35

    Mainframe Refresher Part-1 CICS-Page:1/

    G$If there is no tas is associated ith the terminal+ then ,CP gies the

    control to tas Control Program+ hich reali>es the transaction identifier in the datain ,I*9$ (8CP)

    "$SCP ac6uires the storage area for tas control area (,C9) in hich 8CPreares the control data for this tas$

    F$8CP refer PC, to identify the rogram associated ith the transaction$

    #$Program Control Program (PCP) loads the rogram into main memory fromthe load li&rary and gies the control &ac to 8CP$

    !$8CP gies the control to alication rogram loaded into main memory$

    1E$Program started rocessing = ,as is initiated$Days of %ata Passing &eteen transactions$

    1$ By C*MM9R29$In the eamle &elo+ Doring Storage item DS-I,2M of length DS-723A,H

    is assed to the transaction 2MPC$ ,he rogram for the transaction 2MPC should

    hae %4HC*MM9R29 of si>e DS-723A,H in the linage section to receie theinformation assed &y R2,R3 of this rogram$

    2?2C CICS

    R2,R3 ,R93SI%(2MPC) C*MM9R29(DS-I,2M) 723A,H(DS-723A,H)23%-2?2C

    DS-723A,H is full ord &inary and the maimum length that can &e secified

    is "J8$ So e can ass data of maimum si>e "J8$ But it is recommended not toass more than /J8$

    7I38 and ?C,7 can also hae use C*MM9R29 to ass the information to therogram &eing called and the concet is same$

    /$ 5ueues$

    ,here are to tyes of 6ueues ,S5 and ,%5$ ,S5 can &e used as scratch adin main memory$ @ou can rite as much as you ant in ,S5 and they ill &e

    aaila&le to all the transactions that are aare of the 6ueue name$ ,S5 is rimarilyused to share huge amount of information across the transactions$ Refer 5ueues

    section for more details$

    0$ ,C,C9+ ,D9+ CD9$,D9 = ,ransaction or area = *ne er tas - Dor area associated ith

    the tas$

    ,C,9 = ,erminal Control ,a&le ser 9rea = Dor area associated ith aterminal and defined as one er terminal in ,C,$

    CD9 - Common or area = System or area defined &y systemrogrammer in SI,$ (System Initiali>ation ,a&le)

    De can use ,D9+ ,C,9 and CD9 for sharing the information across the

    transactions$

    2ternal address a&ility using B77 C277S of *S'.S C*B*7Base 7ocator for 7inage is used to access the memory outside you oring

    storage$ If it is used in inut commands lie R29%+ R2C2I.2+ the erformance ill &egood as e ould &e directly accessing the inut &uffer than oring storage item$

    If you ant to access system areas lie CD9+ ,C,9 or CS9 that eist outside yourrogram+ then you should use B77$

    Code 7inage section as &elo:

  • 8/13/2019 CICS V1.0

    13/35

    Mainframe Refresher Part-1 CICS-Page:10

    E1 P9RM-7IS,$

    EG 4I772R PIC S!(E#) C*MP$EG ,C,9-P,R PIC S!(E#) C*MP$

    EG ,D9-P,R PIC S!(E#) C*MP$

    E1 ,C,9-9R29$

    EG ,C,9-I34*RM9,I*3 PIC ?(m)$E1 ,D9-9R29$

    EG ,D9-I34*RM9,I*3 PIC ?(n)$

    ,he maing &eteen the ointers and data area is done in linage section as

    follos$

    4irst filler is oints the current E1 leel+ hich is P9RM-7IS, itself$,C,9-P,R oints to net E1 leel+ hich is ,C,C9-P,R

    ,DS-P,R oints to net E1 leel+ hich is ,D9-P,R$

    In the rocedure diision+ code the folloing:

    2?2C CICS 9%%R2SS ,D9(,D9-P,R) ,C,9(,C,9-P,R) 23%-2?2C$S2R.IC2 R27*9% ,C,9-9R29

    S2R.IC2 R27*9% ,D9-9R29

    ,his ill store the ointer of ,D9 in ,D9-P,R and ,C,9 in ,C,9-P,R$9s the maing &eteen B77 cells and areas is already done in linage section+

    ,C,9-9R29 can access m &ytes of ,C,9+ hich eist outside your oring storageand similarly ,D9-9R29 to access n &ytes of ,D9+ hich eist outside your oring

    storage area$

    ,o ensure the addressa&ility+ S2R.IC2 R27*9% statement should folloheneer the content of B77 cell is changed in anyay$ So there should &e a

    S2R.IC2 R27*9% statement after the 9%%R2SS statement as follos$

    2nhancement &y .S C*B*7/9%%R2SS *4 oerator of .S C*B*7/ easies the access of eternal items$

    ,he a&oe re6uirement can &e met in .S C*B*7/ as follos$ ,here is no need forP9RM-7IS, or S2R.IC2 R27*9%$

    7I389A2 S2C,I*3$

    E1 ,C,9-9R29$

    EG ,C,9-I34*RM9,I*3 PIC ?(m)$E1 ,D9-9R29$

    EG ,D9-I34*RM9,I*3 PIC ?(n)$

    PR*C2%R2 %I.ISI*3$

    2?2C CICS 9%%R2SS ,C,9 (9%%R2SS *4 ,C,9-9R29)

    ,D9(9%%R2SS *4 ,D9-9R29)23%-2?2C$

    9%%R2SS *4 mas the ,C,9-9R29 ith ,C,9 eists outside your oring

    storage$

    9SSIA3 statementIt is used to access the system alue outside of alication rogram$

    Some of them are length of common areas+ user-id$CD9723A+ ,C,9723A+ ,D9723A = assign to full ord &inary oring storage item$

  • 8/13/2019 CICS V1.0

    14/35

  • 8/13/2019 CICS V1.0

    15/35

    Mainframe Refresher Part-1 CICS-Page:1G

    guaranteed in the CICS command leel C*B*7 rograms and so the need and usage

    of these commands are almost o&solete$

    7I38 ?C,7 and C977

    It is good ractice to deelo seeral functional modules rather than &uilding

    one lengthy rogram that does all the functions$ It maes the rogram tough tomaintain+ understand and de&ug$ ,he si>e of the rogram ill &e large and it also

    occuies more resources$ 4unctional slitting of su& modules and calling or

    transferring the control to them is achieed &y 7I38+ ?C,7 and C977$

    CICS rograms are usually run at arious leels$ ,he first rogram+ hichgets the control from CICS+ that is the rogram registered against the transaction in

    PC,+ runs at first leel$ 7ined and Called rograms are running one leel loer thanlining or calling rogram and so the R2,R3 or A* B9C8 in these rograms ill

    gie the control &ac to 7ining or calling rogram$ ?C,7 rograms run at the sameleel and so the R2,R3 gies control to net uer leel$

    Synta: 2?2C CICS 7I38?C,7 PR*AR9M(name) C*MM9R29(s-area)

    723A,H(s-length) 23%-2?2C$

    Ds-length is length of s-area and s-area has the information that needs to&e assed to 7I38'?C,7 rogram$ .S C*B*7 / allos reentrant rogram and so

    hateer is achieed using 7I38 or ?C,7 can &e also achieed &y C*B*7 C977statement$ ,he called rograms should &e attached to the main rogram during lin

    edit and so the si>e of the load module ill &e large in this case$

    Prefer ?C,7 heneer ossi&le as it inoles feer oerheads$ If that is notossi&le then &ased on su&-rogram si>e and ossi&le modification+ go for 7I38 or

    C977$ If the si>e of the rogram is less and used &y only ery fe rograms go forC977 as it ont increase the si>e much at the same time alication ill run fast$

    If the rogram is eecting more changes+ then calling rogram also need to&e comiled for eery change in su& rogram$ In case of 7I38+ the comilation of

    lined rograms is enough$ Called CICS rograms need not &e registered in PP,hereas 7I38 and ?C,7 rograms should &e$

    7*9% and R2729S2

    7*9% is used to load the rogram or ta&le that is comiled or assem&led+ linedited and registered in PP,$ It is mostly used for loading the assem&ler ta&le$

    2?2C CICS 7*9% PR*AR9M(PAM1) S2, (9%%R2SS *4 78-I,2M)723A,H(DS-723A,H)

    23%-2?2C

    Program PAM1 is loaded and the address of the rogram or ta&le is maedto 78-I,2M and so the ta&le can &e accessed using the linage are 78-I,2M$ ,he si>e

  • 8/13/2019 CICS V1.0

    16/35

    Mainframe Refresher Part-1 CICS-Page:1"

    of the linage item is DS-723A,H$ If H*7% eyord is coded in the 7*9%

    command+ then loaded rogram or ta&le ill &e ermanently resident until elicitlyreleased$ If it is not mentioned+ then termination of the tas release the rogram or

    ta&le$

    2?2C CICS R2729S2 PR*AR9M(PAM1) 23%-2?2C is used to release the

    rogram or ta&le$

    9I% and H93%72 9I%

    ,here are certain attention identifiers (9I%) associates ith eery screen$

    2ntry screens hae 23,2R and P41 (Hel) eys$ 5uery screens hae P4F (Page )+P4# (Page don)+ P41 (Hel) and so on$ Based on the ey ressed &y the user+ the

    rocessing should haen in the rogram$ 2IB9I% of %4H2IB78 has the last user

    ressed ey$ It can &e erified in the rogram after the R2C2I.2 command$4or erification of alues in 2IB9I%+ Coy the standard 9I% list coy&oo

    roided &y CICS in your rogram (C*P@ %4H9I%)$ 3o you can easily erify theey ressed as follos$

    2.979,2 2IB9I%DH23 %4H23,2R P2R4*RM P9R9-1

    DH23 %4HP41 P2R4*RM P9R9-/DH23 *,H2R P2R4*RM P9R9-0

    23%-2.979,2$,he a&oe checing is done in C*B*7 and this ind of chec has to &e done

    after eery R2C2I.2 command to roerly route the flo$ CICS roides its onrouting rocessing &ased on the ey ressed &y H93%72 9I% command$ ,his ill &e

    effectie through out the rogram and reduce the code redundancy$ ,he routing ill&e automatically inoed on eery R2C2I.2$

    2?2C CICS H93%72 9I% %4H23,2R(P9R9-1)

    %4HP41(P9R9-/)93@82@(P9R9-0)

    23%-2?2C$

    H93%72 C*3%I,I*3 and 3* H93%722ery CICS command has its on ecetion list$ *ne eamle is M9P49I7

    ecetion of R2C2I.2 command$ H93%72 C*3%I,I*3 is used to transfer control to

    the roer rocedure on eected ecetions$ H93%72 condition cannot tracrogram interruted 9B23%S lie SECJ or SECF$ It deals only ith ecetions of

    CICS commands$,he conditions handled are effectie from here it aears to the end of the

    rogram$ *ne Handle Condition can &e oerridden &y another condition$ ,he main

    rogram conditions ill not &e effectie in su&-rograms$

    2?2C CICS H93%72 C*3%I,I*3M9P49I7(P9R9-1)

    PAMI%2RR(P9R9-/)723A2RR(P9R9-0)

    2RR*R(P9R9-?)23%-2?2C$

    Q9ny error condition other than M9P49I7+PAMI%2RR and 723A2RR ill transferthe control to P9R9-?$

  • 8/13/2019 CICS V1.0

    17/35

    Mainframe Refresher Part-1 CICS-Page:1F

    If you ant to reset the diersion done &y reious H93%72 condition+ code

    the condition name &ut dont mention the aragrah name$ Maimum 1/ conditionscan &e coded in one H93%72 C*3%I,I*3 statement$

    If you ant to deactiate all the conditions for a articular CICS command+code 3*H93%72$ ,here are ossi&ilities for infinite loo hen the CICS command in

    the ecetion routine of the H93%72 C*3%I,I*3 ends ith same ecetion$ In the

    a&oe eamle+ if the there is 723A2RR in P9R9-0 for any of the CICS commandcoded there+ then the control again come to P9R9-0 and forms infinite loo$ In suchcases+ 3*H93%72 ill &e useful (in the 9B23% routine CICS commands)$

    IA3*R2 C*3%I,I*3$

    ,he synta is same as H93%72 C*3%I,I*3 &ut it causes no action to &e

    taen if the secified condition occurs in the rogram$ ,he control ill &e returned tothe net instruction folloing the command+ hich encountered the ecetional

    condition$ It ill &e effectie from the lace here it aears to the end of the

    rogram or until any H93%72 condition oerrides it$Maimum 1/ conditions can &e coded in one IA3*R2 C*3%I,I*3 statement$

    R2SP

    7ie the file status erification of &atch C*B*7 rogram+ S57C*%2 erificationof %B/ rogram+ the success or failure of CICS command can &e done using C*B*7

    statements and this gie more structured loo for the rogram$,o achiee this+ code R2SP along ith CICS command$ CICS ill lace the

    result into the aria&le coded in R2SP$ It can &e checed against %4HR2SP(3*RM97)or %4HR2SP(condition) and aroriately control the flo folloing the command$

    2?2C CICS R2C2I.2 M9P(9) M9PS2,(B) R2SP(DS-RC*%2) 23%-2?2C

    2.979,2 DS-RC*%2DH23 %4HR2SP(3*RM97) P2R4*RM PR*C2SS-P9R9

    DH23 %4HR2SP(M9P49I7) P2R4*RM P9R9-1DH23 *,H2R P2R4*RM P9R9-?

    23%-2.979,2$DS-RC*%2 should &e defined as full ord &inary in oring storage$ If you

    code R2SP+ then H93%72 C*3%,I*3 ill not &e effectie for those CICS commands$

    PSH and P*P$,hey are used to susend and reactiate resectiely+ all the H93%72

    C*3%I,I*3 re6uests currently in effect$ In real life rogramming+ you may ant to

    deactiate all the actie handle conditions and diersions for a su&routine (section)em&edded in the rogram$ ,his can &e achieed using PSH H93%72$ Dhen you

    come out of that section+ you can reactiate all the ushed commands and that can&e done using P*P H93%72$

    H93%72 9B23%

    H93%72 C*3%I,I*3 command intercets only a&normal conditions of theCICS command eecution hereas H93%72 9B23% taes care of any a&normaltermination ithin the rogram$

    2?2C CICS H93%72 9B23%

    79B27(9B23%-R*,I32)R2S2,C93C2723%-2?2C$

  • 8/13/2019 CICS V1.0

    18/35

    Mainframe Refresher Part-1 CICS-Page:1#

    79B27 is to actiate an eit$ C93C27 is used to cancel the reiously

    esta&lished H93%72 9B23% re6uest$ R2S2, is to reactiate the reiously cancelledH93%72 9B23% re6uest$

    S2R-9B23%

    In &atch C*B*7+ the user 9B23%S can &e thron &y calling the assem&ler

    routine I7B*9B3E using 9B-C*%2 hereas 9B-C*%2 is oring storage field of halford &inary$,he folloing command is used to thro user 9B23%S in CICS$

    2?2C CICS 9B23% 9BC*%2(!!!!)23%-2?2C is used to thro user 9B23% !!!!$

    4I72-H93%7I3A$CICS suorts only .S9M and B%9M files$ 9ll the files+ that you ant to use in

    your CICS alication+ should &e registered in 4C, ith their comlete attri&utes$

    CICS commands refer the 4C, entry name for doing oeration on the file$

    9s all the files are already declared and defined in ta&les+ coding 4ile-ControlParagrah of 23.IR*3M23, diision or 4I72 S2C,I*3 of %9,9 %I.ISI*3 is

    meaningless and not re6uired$ ,hus CICS frees the alication rogram from anydata deendant coding$

    ,he unit of I* during R29% is one control interal$ So een you read one

    record into your rogram+ the comlete control interal is read into main memory&uffer$ ,he si>e of control interal is referred to &e large for se6uential rocessing

    and small for random rocessing$

    ,he file should &e *P23 to issue an I-* command$ ,he status of the file can&e 6ueried using the master transaction C2M,$ It can &e *P232%+ C7*S2%+

    239B72% or %IS9B72%$ ,his elicit oening or closing can &e done using C2M,$But this needs human interention$

    CICS .ersion 1$F introduces automatic oening of the file if it is not in oen

    status during the access$ It is alays &etter to close it the hen you no longer needit$ %4*C (%ynamic 4ile *en Close) can &e done in rogram using the S2, command

    or lining to %4H2M,P$

    %4*C B@ 7I38 C*MM93%

    ,he alication rogram lins the master terminal rogram (%4H2M,P) andasses C2M, arameter data re6uired for the file oen'close through C*MM9R29$

    Receiing the data+ %4H2M,P rogram oens'closes the files secified+ after hichthe control is returned to the alication rogram$

    2?2C CICS 7I38 PR*AR9M(%4H2M,P)

    C*MM9R29(DS-C*MM9R29)723A,H(DS-723A,H)

    23%-2?2C

    ,he file oen command is ritten into DS-C*MM9R29 and its length is

    oulated in DS-723A,H$4ile *en Command: S2, %9,9S2,(4C,-39M2) *P232%

    %4*C B@ S2, C*MM93%

  • 8/13/2019 CICS V1.0

    19/35

    Mainframe Refresher Part-1 CICS-Page:1!

    2?2C CICS S2,%9,9S2,(name) 4I72(name)

    *P23C7*S2%23%-2?2C

    %4*C B@ B9,CH ;*B%4*C can &e achieed from a &atch

  • 8/13/2019 CICS V1.0

    20/35

    Mainframe Refresher Part-1 CICS-Page:/E

    723A,H(DS-723A,H)

    S@SI%(S@S,2M-39M2)23%-2?2C$

    ,o release the eclusie access ac6uired during the R29% ith P%9,2+ the

    record should &e R2DRI,,23 using the a&oe synta$ ,he arameters are self-

    elanatory$9fter you read record+ if you feel that you dont ant to udate it+ then inform

    the same to CICS &y issuing 37*C8 command so that CICS release the loc

    ac6uired &y you on the record$2?2C CICS 37*C8 4I72(4C,-39M2) 23%-2?2C$

    DRI,2

    ,he synta of DRI,2 is same as R2DRI,2$ ,here is a arameter RI%47% ith

    8ey-alue is coded in the DRI,2 command$ (7ie SJ for R29% command)Dhen you ant to add a set of records hose eys are in ascending order+

    then 6ualify your first DRI,2 ith another arameter M9SSI3S2R,$ ,his ill geteclusie control oer the file and roide high erformance during the mass insert$

    If you use M9SSI3S2R,+ then you should issue 37*C8 to inform thecomletion of your additions$ CICS releases the file on 37*C8$

    %272,2

    1$,he record read using R29% ith P%9,2 can &e deleted using

    2?2C CICS %272,2 %9,9S2,(4C,-39M2) 23%-2?2C$/$,he record in the file can directly &e deleted &y roiding comlete ey$

    2?2C CICS %272,2 %9,9S2,(4C,-39M2) RI%47%(DS-82@) 23%-2?2C$0$Arou of records can &e deleted using artial ey$ 9fter the deletion+ the num&er

    of records deleted is udated in the aria&le coded in 3MR2C arameter$ (DS-%27-C*3,)

    2?2C CICS %272,2 %9,9S2,(4C,-39M2)RI%47%(DS-82@)

    82@72A3,H(DS-82@-723A,H) A232RIC3MR2C(DS-%27-C*3,)

    23%-2?2C

    S2523,I97 R29%:

    Se6uential access of .S9M file under CICS is called Brosing$ It has 4I.2Commands associated ith it$

    S,9R,BR$

    It esta&lishes a osition to start &rosing$

    2?2C CICS S,9R,BR 4I72(4C,-39M2) RI%47%(DS-82@)82@723A,H(DS-82@-723A,H) A232RICR25I%(Integer-alue)

    S@SI%(S@S,2M-39M2)A,25 2597

    23%-2?2C$

    Meaning of the arameters is same as R29% oeration elanation$ Dhen youant to do multile &rosing concurrently oer the same file+ then use R25I%$ ,he

  • 8/13/2019 CICS V1.0

    21/35

    Mainframe Refresher Part-1 CICS-Page:/1

    first S,9R,BR can &e coded ith R25I%(1) and the second S,9R,BR can &e coded

    ith R25I%(/)$*ne &rose oeration occuies one string of .S9M$ If all .S9M strings are

    ehausted for one .S9M file+ then the other transactions ill hae to ait for one ofthe strings to &ecome free$ So it is not recommended to use multile &rosing$

    Instead+ once the &rosing is comleted+ using R2S2,BR set the osition to another

    lace and start &rosing$ ,he synta of R2S2,BR is same as S,9R,BR$

    R29%32?, and R29%PR2.$

    2?2C CICS R29%32?, R29%PR2. 4I72(4C,-39M2) RI%47%(DS-82@)

    I3,*(DS-I,2M)723A,H(DS-723A,H)

    82@723A,H(DS-82@-723A,H)R25I%(I3,2A2R-.972)

    S@SI%(S@S,2M-39M2) 23%-2?2C$

    R29%32?, is used to read the records in the forard direction from theosition esta&lished &y S,9R,BR$ R29%PR2. is used to read the records in the

    reerse direction$ R29%PR2. folloed &y R29%32?, retriees the same record onceagain$

    %uring the &rose+ if you ant to si set of records+ then moe the ey of

    the net record you intended to read to RI%47% and then issue R29%32?,$ ,his iscalled si se6uential read$ ,hus RI%47% can &e used as &oth inut as ell as outut

    field$9s .S9M files are aria&le length in most of the cases+ DS-723A,H should &e

    oulated ith maimum record length &efore issuing R29% command$82@723A,H(E) ill osition the cursor at the &eginning of the file$

    If you secify R29%PR2. immediately after S,9R,BR+ then you should code

    ey of a record that eists on the dataset$ *therise 3*,43% condition occurs onR29%PR2.$

    23%BRIt is used to terminate the current &rose function$

    2?2C CICS 23%BR 4I72(4C,-39M2) R25I%(I3,2A2R-.972) S@SI%(S@S,2M-39M2)23%-2?2C$

    P%9,2 during BR*DS2

    date and Brose are mutually eclusie functions$ So if you ant to udatea record during the &rose oeration+ first issue 23%BR$ ,hen gie random readusing the ey in hand ith P%9,2 otion$ R2DRI,2 the record$ ,hen issue

    S,9R,BR ith the ey in hand and continue the &rosing$

    2S%S-BR*DSI3A%efine a full-ord &inary item in oring storage for the RB9 of 2S%S file$

    Moe 7*D-.972S or HIAH-.972S to the field for the forard or reerse readresectiely$ Issue S,9R,BR ith RB9 and 2597 otion$ RI%47% should oint to

  • 8/13/2019 CICS V1.0

    22/35

    Mainframe Refresher Part-1 CICS-Page://

    defined RB9 field$ 3o issue R29%32?, or R29%PR2. for forard or R2.2RS2 read

    resectiely$A,25 is inalid for 2S%S$

    M*.2 7*D-.972S ,* 2S%S-RB9

    2?2C CICS S,9R,BR 4I72(4C,-39M2) RI%47%(2S%S-RB9) RB9 2597 23%-2?2C

    M*.2 //" to DS-723A,H$2?2C CICS R29%32?, 4I72(4C,-39M2) I3,*(DS-I,2M) RI%47%(2S%S-RB9)723A,H(DS-723A,H) RB9

    23%-2?2C$

    2S%S-DRI,2,he synta is same as 8S%S DRI,2 command$ 5ualify the DRI,2 ith RB9

    otion$ ,he record ill &e aended to the file and the RB9 of the record is laced

    into RB9 field mentioned in the DRI,2 command$ (2S%S-RB9)

    M*.2 //G ,* DS-723A,H2?2C CICS DRI,2 4I72(4C,-39M2) RI%47%(2S%S-RB9) 723A,H(DS-723A,H) RB9

    23%-2?2C$

    2S%S-R93%*M 9CC2SSIf you no the RB9 alue of the record you ant to access+ then you can

    randomly access the 2S%S file$ ,he synta is same as R29% of 8S%S file &ut 6ualifyit ith RB9 otion$ RI%47% should oint to full-ord &inary item re-filled ith RB9

    of the record to &e accessed$

    RR%S 9CC2SSRR%S file can &e accessed using RR3 in lace of RB9 and oulating the

    RI%47% ith RR3 num&er$ ,he field should &e full ord &inary$

    9lternate Inde accessRegister the ath in 4C, and use the ath name as file name to read the file

    randomly using alternate inde$ Please refer .S9M section of the &oo forunderstanding hat eactly P9,H is$

    9s the alternate ey need not &e uni6ue+ %P82@ condition is ery commonduring the alternate inde usage and so it has to &e roerly handled$

  • 8/13/2019 CICS V1.0

    23/35

    Mainframe Refresher Part-1 CICS-Page:/0

    9S8,IM22IB%9,2 and 2IB,IM2 hae the alues at tas initiation time$ on the

    comletion of 9S8,IM2+ these to fields are oulated ith current date and time$

    2?2C CICS 9S8,IM2 23%-2?2C$

    4*RM9,,IM24*RM9,,IM2 is used to receie the information of date and time in arious formats$

    2?2C CICS 4*RM9,,IM2 4*RM9,-,@P2(data-area) 23%-2?2C4ormat-tye: @@%%%+ @@MM%%+ @@%%MM+ MM%%@@+ %%MM@@+ %9@*4D228+

    %9@*4M*3,H+ M*3,H*4@29R+ @29R+ ,IM2+ ,IM2S2P+ and%9,2S2P$

    2amle:2?2C CICS

    4*RM9,,IM2 MM%%@@(DS-%9,2) %9,2S2P ,IM2(DS-,IM2) ,IM2S2P 23%-2?2C

    DS-%9,2 contains the current date in MM'%%'@@ (%efault %9,2S2P is ')

    DS-,IM2 contains the current time in HH:MM:SS (%efault ,IM2S2P is :)

    %279@ and SSP23%It is used to delay the rocessing of a tas for a secified time interal or until

    the secified time$ If your tas is doing some heay CP &ounded or+ it is a goodto lace the %279@ command in order to allo the other tass to roceed$

    2?2C CICS %279@ I3,2R.97(HHMMSS) ,IM2(HHMMSS) 23%-2?2C$

    SSP23% is used to susend a tas$ %uring the eecution of the command+

    the tas ill &e susended and the control ill &e gien to other tass ith higherriority$ 9s soon as all higher riority tass hae &een eecuted+ control ill &e

    returned to the susended tas$2?2C CICS SSP23% 23%-2?2C$

    P*S, and D9I, 2.23,

    P*S, is used to re6uest notification hen the secific time has eired andthe D9I, 2.23, command is used to ait for an eent to occur$ sually these tocommands are used in air+ as alternatie to the %279@ command$

    2?2C CICS P*S, I3,2R.97(HHMMSS) ,IM2(HHMMSS)S2, (9%%R2SS *4 P*S,-2CB) 23%-2?2C$

    23%-2?2C2?2C CICS D9I, 2.23, 2C99%%R(9%%R2SS *4 P*S,-2CB)

    23%-2?2C

  • 8/13/2019 CICS V1.0

    24/35

    Mainframe Refresher Part-1 CICS-Page:/J

    C93C27

    It is used to cancel the interal control commands such as %279@+ P*S, andS,9R, hich hae &een issued$ ,he interal commands to &e cancelled are identified

    using R25I%$

    2?2C CICS S,9R, R25I%(S,9R,S) 23%-2?2C$

    2?2C CICS C93C27 R25I%(S,9R,S) 23%-2?2C$ Cancels all the starts issued$

    S,9R, and R2,RI2.2S,9R, command is used to start a transaction at the secified terminal and at

    the secified time or interal$ *tionally+ data can &e assed to the to-&e-initiated

    transaction$2?2C CICS S,9R, ,R93SI%(2MPC) ,2RMI%(,S,1) S1

    ,IM2(1/0EEE)I3,2R.97(EE0EEE) S/4R*M(DS-I,2M) 723A,H(DS-723A,H) S0

    R,R93SI%(2MP%) R,2RMI%(,S,E) SJ522(2MP%2,) SG

    23%-2?2C$

    S1$ 2MPC is to &e started at the terminal ,S,1S/$ ,IM2 and I3,2R.97 are mutually eclusie$ If ,IM2(HHMMSS) is coded+ then

    the tas start at the terminal at the secific time$ In the a&oe eamle it is 1/:0E$If I3,2R.97(HHMMSS) is coded then the tas ill start after the eiry of the

    interal$ In the eamle+ the tas starts after 0E minutes$S0$ ,his rogram asses DS-I,2M of si>e DS-723A,H to the tas 2MPC$

    SJ$ ,ransaction I% 2MP% and ,erminal Id ,S,E are assed to 2MPC$ 2MPC canreceie this information and may use for net triggering$

    SG$ ,S5 6ueue name can &e assed from this transaction$ 2MP%2, is assed inour case$

    ,he data assed &y S,9R, command is receied &y the ne transaction using

    R2,RI2.2 command uon the eiry of S,9R, command$

    2?2C CICS R2,R2I.2 I3,*(DS-I,M2) S2,(9%%R2SS *4 78-I,2M)

    723A,H(DS-723A,H)R,R93SI%(DS-,R93) R,2RMI%(DS-,2RM)

    522(DS-522)23%-2?2C$

    235 and %25

    235 gets the eclusie control oer the resource and %25 releases theeclusie control ac6uired oer the resource$ 9s CICS taes care of eclusie accessoer the resource heneer needed+ it is adisa&le not to use it in alication

    rograms$But sometimes it may &e needed in fe cases lie udating ,S5 records or

    getting access of the rinter$2?2C CICS 235'%25 R2S*RC2(522-39M2) 23%-2?2C$

    S@3CP*I3, and ,D*-PH9S2-C*MMI,

  • 8/13/2019 CICS V1.0

    25/35

    Mainframe Refresher Part-1 CICS-Page:/G

    ,he udates done &y a tas is automatically committed at tas termination$

    S@3CP*I3, is used to commit ortion of or comleted ithout terminating thetas$

    2?2C CICS S@3P*I3, 23%-2?2C$%uring the rogram rocessing+ if you ant to roll &ac the changes made &y

    you+ then you can code S@3P*I3, ith R*77B9C8$ ,his ill &aced out all resource

    modifications done since the last sync oint$2?2C CICS S@3CP*I3, R*77B9C8 23%-2?2C$S@3CP*I3, in CICS-%B/ enironment is called as to-hase commit$

    ,he changes made in the resources that are directly under the control of CICS arecommitted in the first hase and the changes made to %B/ enironment are

    committed in the second hase$

    5ueues

    ,here are to tyes of 6ueues aaila&le in CICS$

    1$,emorary Storage 5ueue (,S5)/$,ransient %ata 5ueue (,%5)

    ,heir roerties are listed &elo:

    ,S5 3o need to redefine anyhere$ By default+ ,S 6ueues are created in mainmemory$ So the content cannot &e recoered after system crash$ If you

    ant to recoer+ then you should define them in ,S,$

    Records can &e randomly accessed using I,2M otion of R29%5$ R29% is not

    destructie$

    %eletion of 6ueue deletes all the records in it$ %eletion of recoera&le ,S5should follo sync oint &efore net DRI,25$

    Primarily used as scratch ad memory facility for any urose$

    2amle: Page-u and Page-don logic+ Passing huge data in &eteen thehases of transaction+ Reie and correction of multile order entry screens$

    ,%5 ,%5 should &e redefined in %C,$

    R29% is destructie and only se6uential$ *nce the record is R29%+ it ill &e

    logically deleted and cannot &e read again$

    9utomatic ,as Initiation: Dhen num&er of records in the 6ueue eceeds the,RIA72. defined in the %4H%C, entry of the 6ueue+ the transaction coded in

    the ,R93SI% of %4H%C, is automatically triggered$ ,his 9,I is ossi&le onlyin ,%5$

    ,here are to tyes of ,%5 = Intra and 2tra artition$ ,he %C, entryidentifies the tye of 6ueue from ,@P2 arameter$

    Intra Partition 5ueues are used ithin a CICS region and %272,25 deletesall the records hysically in the 6ueue$

    2tra artition 5ueues are used across the regions and systems$ If you ant

    to ass some data from CICS to &atch or receie data from Batch to CICS+you should go for etra artition 6ueue$

  • 8/13/2019 CICS V1.0

    26/35

    Mainframe Refresher Part-1 CICS-Page:/"

    In the same rogram ,%5 cannot &e oened in &oth inut and outut mode$

    ,S5 are referred oer ,%5 for data assing$ ,%5 is used for &atch interfaceor on 9,I re6uirement$

    MR* and ISC

    Dithin one rocessor+ there could &e more than one CICS region+ each ofhich runs indeendently under the same oerating system$ ,his is called Multi

    region *eration$ (MR*) $It is achieed &y four inter communication facilities$1$4unction Re6uest Shiing$

    /$9synchronous Processing$0$,ransaction routing$

    J$%istri&uted ,ransaction Processing$*ne CICS in one rocessor can communicate ith other CICS in other

    rocessor or other non-CICS system regardless of here the other rocessorhysically located$ ,his is called Inter System Communication (ISC)$ It re6uires

    sohisticated communication netors &ased on the System 3etor 9rchitecture(S39)$

    M9S,2R ,R93S9C,I*3S

    C2M,:,his is Master ,erminal transaction$ It is menu drien and easy-to-use

    transaction &ut due to its nature of maniulating the CICS enironment+ most of the

    functions are restricted to alication rogrammer or end user$C2M, I35IR2S2,P2R4*RM

    C2M, I35 ,R93PR*4I72 = %islay information from PC,PP,4C,C2M, I3D ,9S8 = %islay the actie running tass in the region

    C2M, S2, command can &e used to reset the alues of PC,PP,4C,$P2R4*RM has to &e handled carefully$ C2M, P2R4*RM SH,%*D3 ill shut don

    the entire CICS region$4re6uently used commands:

    C2M, S2, PR(PAM-39M2) 32D - ,o create a ne coy of an alication rogramC2M, S2, %9(file-name) C7*'*P23 - ,o close'oen a file from CICS$

    C2CI:

    ,his is Command Interreter transaction$ CICS commands can &e re-tested

    using this command &efore lacing them into the rogram$C2BR:

    ,his is &rose transaction$ ,S5 can &e &rosed using this transaction$

    C2%4:,his is %iagnostic 4acility transaction$ If you ant to de&ug your rogram ste

    &y ste+ then &efore tying transaction I% tye C2%4 so that de&ug mode ill &e set$It intercets a transaction at initiation and termination of a rogram+ &efore and after

    eecution of any 2?2C CICS or 2?2C S57 commands$CM9C:

  • 8/13/2019 CICS V1.0

    27/35

    Mainframe Refresher Part-1 CICS-Page:/F

    ,his transaction is used to get 9B23% codes and messages$

    %ifferent ays of initiating a transaction in CICS1$By entering transaction identifier$

    /$By S,9R, command$

    0$By R2,R3 ,R93SI%J$By registering the rograms in P7,+ they ill &e automatically initiated during CICSstartu$

    G$9utomatic ,as Initiation of ,%5$"$P4 or P9 eys could &e defined in PC, to initiate a CICS transaction$

    CICS %um 9nalysis%um usually consists of %um Header 9rea+ ,C9(ser 9rea)+ ,C9(System

    9rea)+ ,race ,a&le+ ,ransaction Storage and Program Storage$

    9t the to of the 9B23% dum+ there is a dum header area+ hich roides

    9B23% code+ ,9S8 (the transaction I%)+ Program Status Dord (PSD) and thecontents of registers at the time of 9B23%$

    PSD$

    It is a dou&le ord field containing the status information at the time of9B23%$ 0/nd&it says the addressing mode in use$ If the addressing mode is 01 &its+

    then the &it ill &e 1 and the &its 00 to "0 contains the net se6uential instruction(3SI)+ hich ould hae &een eecuted if the 9B23% had not occurred$

    4irst mae sure that you hae rogram comilation and lin edited

    S@SPRI3,S of the rogram 9B23%2% and dum rints of the 9B23%2% transactionis ith you$ Program should &e comiled ith 7IS, otion$

    4inding the statement caused the 9B23%

    1$Identify the address of net se6uential instruction from the PSD$

    /$ 4rom the rogram storage+ identify the starting address of rogram storage$

    0$Su&tract the starting address of rogram storage from the 3SI address identified in

    the first ste+ you ill get the dislacement of the 3SI from the &eginning of

    rogram storage$

    J$4ind the dislacement of alication rogram from the &eginning of the loadmodule in the lin edit list and su&tract this alue from the calculated 3SI

    dislacement to get the real 3SI dislacement$

    G$4ind the statement in the comilation listing that corresonds to the *44S2,calculated in the reious ste$ ,he statement one a&oe is the statement thatcaused the 9B23%$

    "$9nalyse the statement for the cause of 9B23%$ ,his might hae inoled one or

    more fields$ Most of the times+ you can easily come to conclusion the cause of the9B23% once you identified the statement$ If you could not+ then you may chec the

    alue of the field at the time of 9B23% as follos$

  • 8/13/2019 CICS V1.0

    28/35

    Mainframe Refresher Part-1 CICS-Page:/#

    4inding the alue of the field in error$

    1$4ind the Base 7ocator (B7)+ %islacement and length of the field from the M9P ofcomilation listing$

    /$ 4ind the register num&er corresonding to the &ase locator from the &ottom ofcomilation listing$

    0$ 4ind the address of this register in the dum$

    J$ 9dd the dislacement to the register of the address to get the address of the field$G$ 7ocate the address in the dum to get the alue of the field$

    CICS ,9B72 23,RI2S

    4C,

    9ll the .S9M files+ P9,H &eteen &ase cluster and alternate inde and anyB%9M datasets are to &e registered in 4C, to access them in the alication

    rogram$

    %4H4C, ,@P2 %9,S2, 4I72+9CCM2,HB%9M .S9M+

    %9,9S2, name 4I72name+S2R.R25 (9%%+ BR*DS2+ %272,2+ R29%+ P%9,2)+

    4I72S,9, (239B72%%IS9B72%+ *P232%C7*S2%)+B43% n1+

    B43In+S,R3*n+

    %S39M2name+%ISP*7% SHR+

    B9S2name+

    9CCM2,H defines data access method$3ame mentioned in the 4I72 arameter is the one ith hich e use in the

    CICS file commands$ ,he name should corresond to the %%39M2 of the filesecified in the ;C7 of the CICS ed inut'outut oerations against the file$ If other

    than the secified serices is re6uested in the file control command+ then I3.R25condition ill occur$

    4I72S,9, indicates the initial file status hen CICS initially starts$ B43% andB43I indicate the num&er of data &uffers and inde &uffers resectiely$ %efault

    alue is one for B43I and to for B43%$ S,R3* is the num&er of .S9M strings &y

    hich concurrent access to the file is alloed$

    If the file &eing registered is ath+ then B9S2 indicates the 4C, name of the&ase cluster$

    PP,

    9ll the CICS alication rograms and BMS ma sets must &e registered inPP,$ If the rogram is not registered here+ then the rogram is unrecogni>a&le to

    CICS$

  • 8/13/2019 CICS V1.0

    29/35

    Mainframe Refresher Part-1 CICS-Page:/!

    %4HPP, ,@P223,R@+

    PR*AR9Mname M9PS2, namePAM793A(9SS2MB72R C*B*7 P7I)+

    otions$$

    9SS2MB72R is the default rogram language$ 9ll the ma-sets are considered as

    ritten in assem&ler$

    PC,

    ,he control information of all CICS transactions must &e registered in

    rogram control ta&le (PC,)$

    %4HPC, ,@P223,R@+,R93SI%name+

    ,9S8R25+ (P41-P4/J+ P91-P90)PR*AR9Mname+

    %,IM*,mmss+R,IM*,mmss+

    R2S,9R, 3* @2S+,R93S2C1 %2CIM97+ (1-"J)

    %MP@2S3*+O*ther otions$$

    ,R93SI% = ,ransaction identifier name (1-J characters)

    PR*AR9M = 3ame of the rogram associated ith the transaction$,9S8R25 - 8ey associated ith the transaction initiation$

    %,IM*, - %efines the timeout (aiting time) in case of deadloc$R,IM*, - %efines the time limit ithin hich the user has to resond$ If

    he didnt then the tas ill &e cancelled$R2S,9R, = 9utomatic transaction is alied after the comletion of the

    transaction recoery from the a&normal termination of the transaction$,R93S2C =,ransaction security code$

    %MP - Dhether %MP is to &e taen in case of a&normal termination

    of the transaction$

    ,C,9ll the terminals+ hich are to &e under CICS control+ should &e registered in

    ,C,$ ,erminal Control Program uses this ta&le for identifying the terminals and

    erforms all inut'outut oerations against these terminals$

    %4H,C, ,@P223,R@+9CCM2,H.,9M+

    ,RMI%3,name+,RM,@P2tye+

    429,R2(C,R93+$$)*tions$$

    ,RMI%3, is (1-J characters) terminal I%$

  • 8/13/2019 CICS V1.0

    30/35

    Mainframe Refresher Part-1 CICS-Page:0E

    ,RM,@P2 is tye of terminal$ 2$ IBM0/FE$

    429,R2 indicates the terminal serices CICS offers$ C,R93 is used totranslate all the loercase characters to uer case characters$

    %C,,%5 control information is registered here$ %estination Control Program uses

    this ta&le for identifying all ,%5s and erforms inut'outut oerations against

    them$

    Intra artition 6ueue can &e defined as follos$%4H%C, ,@P2I3,R9+

    %2S,I%name+,R93SI%name+

    ,RIA72.num&er+R2S2 @2S3*

    ,@P2 can &e I3,R9 (Intra artition ,%5)

    9,I:

    ,R93SI% and ,RIA72. are used for automatic tas initiation$ If the num&er ofrecords in ,%5 eceeded the num&er of records mentioned against ,RIA72.+ then

    transaction I% mentioned against ,R93SI% ill &e inoed automatically$

    *nce a record of intra artition ,%5 is read &y a transaction+ the record is logicallyremoed from+ the 6ueue$ If R2S2 @2S is coded+ then the sace occuied &y it

    can &e used &y other records in future &ut the logically deleted records are notrecoera&le$

    2tra artitioned 6ueue can &e defined as follos$

    %4H%C, ,@P22?,R9+

    %2S,I%name+%SC39M2name-/+

    *P23I3I,I97%242R2%%4H%C, ,@P2S%SCI+

    %SC39M2name-/+

    ,@P4I72I3P,*,P,R%B9C8

    *P23I3I,I97 means the file ill &e oen at the CICS start-u time and%242R2% means the file ill &e closed until it is secifically oened &y C2M,$

    %SC39M2 defines data control &loc and for one %SC39M2+ a corresonding%4H%C, entry must &e made ith ,@P2S%SCI and the same %SC39M2+ hich in

    effect indicates %%39M2 of etra artition dataset in ;C7 or CICS ;*B itself$,@P4I72 indicates the file to &e I3P,+ *,P, or R29% B9C8D9R%

    (R%B9C8)

  • 8/13/2019 CICS V1.0

    31/35

    Mainframe Refresher Part-1 CICS-Page:01

    9B23% C*%2S

    Dhen a CICS tas is terminated a&normally+ an 9B23% code ill &e shonith the a&normal termination message$ 9ll such 9B23% codes can &e groued into

    to categories$1$ 9B23%S that are related ith ecetion conditions$

    /$ 9B23%S that are not related ith ecetional conditions$

    Selected 9B23%S that are related ith CICS ecetions conditions:

    9B23% Condition 9B23% Condition

    92I9 2RR*R 92I% 2*4

    92I; 3*S,9R, 92I8 ,2RMI%2RR

    92I7 %SI%2RR 92IM 3*,43%

    92I3 %PR2C 92I* %P82@

    92IP I3.R25 92I5 I*2RR

    92IR 3*SP9C2 92IS 3*,*P23

    92I! M9P49I7 92?7 %IS9B72%92@H 5I%2RR 92@7 43C2RR

    92@5 S@SI%2RR 92I, 23%4I72

    92I I77*AIC 92I. 723A2RR

    92ID 5N2R* 92IN I,2M2RR

    92IE PAMI%2RR 92I1 ,R93SI%2RR

    92I/ 23%%9,9 92@@ 3*,977*C

    9B23%S not related ith CICS ecetion conditions$

    9B23% Reason Code

    9SR9 9B23% due to rogram interrution$

    9SRB 9B23% due to *S 9B23% interceted &y CICS

    98C, Read time-out encountered

    98CS %eadloc time out encountered

    9IC9 ,ransaction a&ended as a runaay tas

    92@! nsuorted command issued

    92@F R9C4 failure

  • 8/13/2019 CICS V1.0

    32/35

    Mainframe Refresher Part-1 CICS-Page:0/

    9BMP P9'P4 ey not defined for age retrieal

    9BMA Re6uested BMS serice not included at S@SA23$

    I3,2R.I2D 52S,I*3S1$,S5 and ,%5 = %ifference and hen ill you go for hat KKKKK

    /$9utomatic ,as Initiation = Dhat it means KKKKK0$Dhat are the ays of initiating a transaction in CICS KKKKK

    J$Dhat are the ays+ data can &e assed &eteen transactions KKKKKG$,as initiation rocess in CICS KKKK

    "$7I38+ ?C,7 and C977 difference and hen you refer hat KKKKF$Imortance of RC, ta&le KKKK

    #$ Dhat is 9SR9 Ho do you sole KKKK!$%efination of Pseudo conersation$ KKK

    1E$%ifference &eteen Sym&olic and Physical ma KKK11$Dhat is M%, Days of setting and resetting M%, KKKKK

    1/$Days of ositioning the cursor in screen KKKK10$4e error codes+ you faced in CICS deeloment KKK

    1J$Ho the ecetions are handled in CICS KKK1G$Ho to su&mit a ;C7 from a CICS Program KKK

    1"$Ho do you oen a file in CICS KK1F$Dhat are the ays you can release the eclusie access ac6uired oer

    the control interal during R29%-P%9,2 KKK1#$Ho many conditions can &e coded in one H93%72'IA3*R2 condition KK

    1!$Dhat is to-hase commit KK/E$Ho ould you read the last record of 2S%S .S9M file KK

    /1$Dhat is the limitation of C*MM9R29 and hy this limitation KK//$Ho do you get current date and time+ user-id in CICS enironment KK

    /0$Ho to read 1Ethrecord of ,S5 directly and ho to delete the 1Ethrecord

    of the ,S5 KKK/J$Dhat is M9P49I7 KK

    /G$Dhat are PSH and P*P and hen they are useful KK

    /"$Dhat are the comiler otions ith hich your C*B*7 rogram hasto &e comiled to use in CICS region KKK

    /F$Dhat is reentrant and 6uasi-reentrant KKK

    /#$Dhat haens hen the rogram lined' ?C,7ed is not found in PP, K/!$9ll the C*B*7 rograms ith CICS commands need to &e registeredin PP, though they are called &y C977 statement$(@'3) KK

    0E$ Dhich is the 2IB field that determines hether the C*MM9R29 as sentor not KK

    01$PP, and PC, contents KKK0/$Ho to read the file using artial ey KKK

    00$Dhen R2DRI,2 issued ithout R29% P%9,2+ hat ill haen KKK0J$Dhat is transaction deadloc KK

  • 8/13/2019 CICS V1.0

    33/35

    Mainframe Refresher Part-1 CICS-Page:00

    0G$Ho ill you eecute the coded CICS-%B/-C*B*7 Program $

    2lain from comilation stage$ KKKK0"$Dhy %B/ re comilation is done &efore CICS translation

    Dhat ill haen if I reerse the order KKK0F$ Dhich is the arameter of the %4H4C, macro that is used to translate

    all loer-case characters to uer-case for 0/FE terminals KK

    0#$Dhich is the 9I% that ill not &e identified in the 93@82@ otion ofthe H93%72 9I% command KK0!$Dhat facility connects CICS and %B/ KKK

    Ho to su&mit ;C7 from a CICS rogram;C7 can &e su&mitted using the SP**7*P23+ SP**7DRI,2 and SP**7C7*S2

    commands$

    4irst you must oen a sool for outut using SP**7*P232?2C CICS

    SP**7*P23 *,P, 3*%2(TKT) S2RI%(I3,R%R) ,*823(reortUtoen) R2SP(resonse field)

    23%-2?2C$

    3*%2(TKT) secifies a destination node to send the ;C7 to$ S2RI% is set tothe name of the internal reader I3,R%R$ 9 uni6ue toen ill &e allocated &y CICS

    hen the SP**7*P23 is eecuted and laced in the field you secify using,*823(reortUtoen)$ ,he toen ill &e used as a sending field on su&se6uent

    commands$ ,he toen ill &e # &ytes long$

    ,o rite each line of the

  • 8/13/2019 CICS V1.0

    34/35

    Mainframe Refresher Part-1 CICS-Page:0J

    %C, entries and ;C7 %% statements are not needed hen using this method$

    3ote that in order to use this method %4HSI, SP**7@2S must &e coded inthe CICS System Initiali>ation ,a&le$ Chec ith your friendly local SysProg if

    you are unsure$

    nder *S'.S C*B*7 the SP**7DRI,2 command had to hae 4723A,Hsecified$ 4723A,H secifies the length of the data &eing ritten in a fullord

    &inary field$ ,his field is otional in neer ersions+ if it is omitted then thelength is assumed to &e the length of the data item (io-area) secified in

    4R*M$

    Be aare of the erformance considerations for riting to the sool+ IBM saysV,ransactions that rocess S@S*, data sets larger than 1EEE records+ either for

    I3P, or for *,P,+ are liely to hae a erformance imact on the rest of CICSV$

    (Source: CICS'2S9 .JR1 9lication Programming Reference SC00-11FE-EE)

  • 8/13/2019 CICS V1.0

    35/35

    Mainframe Refresher Part-1 CICS-Page:0G

    3*,2S