www.mainframes-online-training.weebly.com Polsani Anil Kumar Program Preparation CICS Training Class -03
Sep 05, 2015
Required Steps
Preparing a COBOL-CICS Program.Write a programCompileDefine the program in PPT table with in CICSDefine the transaction to the program in PCT table.Execute the program with the Defined Transaction.Concepts to be Known
Before we start writing a program one should be clear withTASK and TransactionMultitasking & MultithreadingQuasi- Reentrancy Conversational ModesTask & Transaction
Task: a basic unit of work which is scheduled by the operation system / CICSSending a map / Receiving a mapTransaction : Is an entity which initiates execution of a task. In CICS transaction is identified by the transaction identifier known as TRANS-ID.Trans-ID is a 4 character length alpha-numeric name but should not start with character C which are actually used by the system related transaction.Multi-Tasking
When CICS receives a request to run a the program, CICS starts running instance of requested program for that user.Simultaneously if CICS receives another request to run the same program/another program, CICS starts running instance of that request program for that user also.Like this CICS can able to handle thousands of requests, can able to run multiple tasks simultaneously.This capability of executing multiple tasks by a single system is called multitaskingMulti-threading
Multithreading is sub-concept of multi-tasking.Multithreading is a technique that almost a single copy of a program to be processed by several transaction concurrentlyFor example: one transaction may begin to execute an application program, while these happening another transaction may then execute the same copy of the application program
Quasi- Reentrancy
The feature of storing the program data in a separate storage area, when there is a interruption and restoring the same state is known as Reentrancy but in CICS its called Quasi- Reentrancy process. When CICS receives 1st request to a program, CICS starts executing that program, at the same time, another request(2nd) received by CICS, which is more priority, then CICS halts processing of 1st request & preserve its state to separate storage area and initialize the program. Once second request is over. It initializes the program again & restores 1st request state to this program and start executing the program.Terminal Conversation
Conversational: A mode of dialogue between program and terminal based on a combination of sending message and receiving message within the same task.Since human response is slower than the CPU speed a significant amount of resource will be wasted just waiting.Pseudo-Conversational: A mode of dialog between program and terminal which appears to the operator as a continues conversation but which is actually carried by a series of tasks.We can achieve the pseudo-Conversational with a variable EIBCALEN which is defined with in DFHEIBLK CopybookCICS Consideration & Restrictions
Must eventually return control to CICS
Achieved by using RETURN CommandShould not code ENVIRONMENT DIVISION
So no CONFIG OR INPUT-OUTPUT SECTIONNo FILE SECTION so no OPEN CLOSE READ OR other COBOL file related verb instead we use CICS read & write command
ACCEPT DISPLAY STOP RUN and even GOBACK are avoided. Stop run & GOBACK are sometimes included in order to eliminate compiler diagnostic but never executed at all.
Required Copy Books
To write a COBOL-CICS program we may be required few of the below mentioned COPY BOOKSSYMBOLIC Map
DFHEIBLK
DFHAID
DFHBMSCA
Symbolic Map
Symbolic map can be generated at the time of BMS map compiler or manuallyThis copybook contains group item named MAPNAMEI is redefined by a group item named MAPNAMEO. The fields in the MAPNAMEI group item are intended for use with input operations, and the fields in the MAPNAMEO group item are intended for use with output operations.The symbolic map contains a data field, a length field, an attribute field, and a field that indicates if the value of the field has changed. The names for these fields are created by adding a onecharacter suffix to the label that was coded on the DFHMDF macro in the mapset.DFHEIBLK Copybook
EIB EXEC INTERFACE BLOCK contains some system related information to each task as exec interface blockLIKE:EIBAID Attention-id (1 BYTE)EIBCALEN Length Of DFHCOMMAREA/COMMAREA (S9(4)comp)EIBDATE/EIBTIME Date & Time When The Task Started EIBFN Function Code Of The Last Command EIBRCODE Response Code Of Last CommandEIBTRNID Transaction Id 1-4 CharsEIBTRMID Terminal-id 1-4 CharsDFHAID Copy Book
AID is used to initiate the task from the terminalAll the AID keys are defined under DFHAID copybook AID keys:PF Keys PA Keys . Enter and clear keysHANDLE AID can be used to handle when any AID key is invoked instead we can use EIBAID of EIB to work in application programDFHBMSCA
IBM also supplies a standard copy member, named DFHBMSCA, that defines many attribute settings.You can change the colour, and protection attributes by changing the A field. To do this you should copy the DFHBMSCA copybook into working storage. This contains definitions for attributes e.g. DFHBMASK to set a field to SKIP. Then move the required attribute to the 'A' field.SEND Command
EXEC CICS
SEND MAP(MAP')
MAPSET(MAPSET')
FROM(INQMAP1O) [DATAONLY/MAPONLY]
CURSOR(VALUE)
[ALARM | FREEKB | ERASE | FRSET ]
HANDLE/NOHANDLE
RESP(WS-DATA-ITEM)
ENDEXEC.
Conditions : LENERR, INVREQ
RECEIVE Command
EXEC CICS RECEIVE
MAP(MAPNAME)
MAPSET(MAPSET NAME)
INTO(DATANAME)
LENGTH(MSG-LEN)
HANDLE/NOHANDLE
RESP()
END-EXEC.
Conditions : MAPFAIL, INVREQ
RETURN Command
EXEC CICS RETURN
TRANSID(NAME)
COMMAREA(DATA-VALUE)
LENGTH(DATA-VALUE)
END-EXEC.
Conditions : LENERR, INVREQ
COBOL + CICS Compilation
The COBOL + CICS undergoes three levels of processing to generates the Load Module.Translation process DFHECP
Compilation IGYCRCTL
Link-edited IEWL / HEWL
Translation Process
Now we have a source code with COBOL + CICS then a normal compilation process cannot be good enoughHere we use a process know as TRANSLATION process to remove the CICS command and replace with COBOL understandable code like COMMENT and CALLIn this process a COPYBOOK DFHEIBLK will be included with-in the linkage section of the application programThe modified code then further get processed and generates the LOAD MODULEEntries Required in CICS Environment
The application program and the related map has to be defined in the PPT table and a transaction id to initiate the task in pct table.PPT ENTRYCEDA DEF MAPSET(MAPSET NAME) G(GROUP NAME)CEDA INS MAPSET(MAPSET NAME) G(GROUP NAME)CEDA DEF PROGRAM(PROGRAM NAME) G(GROUP NAME)CEDA INS PROGRAM(PROGRAM NAME) G(GROUP NAME)PCT ENTRYCEDA DEF TRANS(TRAN-ID) PROGRAM(PROGRAM NAME) G(GROUP NAME)CEDA INS TRANS(TRN1) G(GROUP NAME)To know all entry with in a groupCEDA DI G(GROUP NAME)www.mainframes-online-training.weebly.com Polsani Anil Kumar
Thank You
Polsani Anil Kumar