Professional Documents
Culture Documents
1
Session Objectives
To understand
2
Host Languages
CICS supports the following host languages :
• COBOL
• Assembler
• PL/1
• C and C++
• Java
3
Application Programming in CICS
Some steps to be followed in pseudo-conversation programs:
●
The length of the commarea will be checked to decide whether the map is
being sent for the first time or not. Initially, the map has to be sent when
EIBCALEN is 0.
●
When the map is with the user awaiting response, pseudo conversation
happens with the help of the RETURN command. The commarea needs to
be populated with some value so that EIBCALEN will not be zero on re-
entry.
●
The second time, the map will be received and the values will be obtained
within the program. After processing the data, it can be sent to the screen
again.
4
Pseudo-Code for COBOL - CICS program
DEFINE THE COMMAREA IN THE WORKING STORAGE SECTION.
DEFINE THE DFHCOMMAREA WITH THE SAME SIZE OF COMMAREA IN LINKAGE SECTION.
MOVE DFHCOMMAREA TO WS-COMMAREA
IF EIBCALEN = 0
END-IF
5
CICS Command Format
EXEC
EXEC CICSCICSfunction
function
[option
[option ( argument
( argument value)]
value)]
[option
[option ( argument
( argument value)]
value)]
... ...
[RESP
[RESP ( argument
( argument value)]
value)]
END-EXEC
END-EXEC
6
Argument values
• Data Value
• Data Area
• Name
• Label
• Time in hhmmss format
• Pointer Reference
7
SEND COMMAND(1/2)
Send command is used to send the map/text to the user for
responding to a request.
8
SEND COMMAND(2/2)
Some of the parameters are as follows:
9
RECEIVE COMMAND(1/2)
Receive command is used to receive screen input into the data
area in the application program. This data can then be logically
processed.
10
RECEIVE COMMAND(2/2)
11
RETURN COMMAND(1/2)
Return command is used to return control from an application
program either to another application program at the next
higher logical level or to CICS.
12
RETURN COMMAND(2/2)
2. Return command to exit from the program completely and provide control to
CICS.
13
CICS Program Preparation
14
CICS - DB2 Program Preparation
Bind
Compiler
Listing
15
CICS Program Preparation
16
Compiling the CICS Program
A CICS program contains the EXEC CICS command. The language
compilers are unaware of that command. Therefore a kind of pre-processor
is necessary to translate each EXEC CICS commands into a language-
specific CALL statement.
Language statements remain unchanged, but CICS commands are
translated into CALL statements of the form required by the language in
which you code.
The CALL invokes a CICS-provided "EXEC" interface module or stub, which
is a function-dependent piece of code that the CICS high-level programming
interface uses.
17
CICS Statements after Translation
Original Source Code :
EXEC CICS
READ DATASET(ACCMSTR) INTO(ACCT-MSTR-DTLS)
RIDFLD(ACCT-NO) RESP(RESP-CODE)
END-EXEC.
Translated Source
* EXEC CICS
* READ DATASET(‘ACCMSTR’) INTO(ACCT-MSTR-DTLS)
* RIDFLD(ACCT-NO) RESP(RESP-CODE)
* END-EXEC.
MOVE ‘..0……00061 ‘ TO DFHEIV0
MOVE ‘ACCMSTR’ TO DFHC0080
MOVE LENGTH OF ACCT-MSTR-DTLS TO DFHB0020
CALL ‘DFHEI1’ USING DFHEIV0 DFHC0080 ACCT-MSTR-DTLS
DFHB0020 ACCT-NO
MOVE EIBRESP TO RESP-CODE.
18
Link-Editing a CICS Program
High-Level language (HLL) compilers produce a program, listing all the
information that it generated during the compilation. Additionally, another file
is created that contains the object code. This newly created file is input for
another program, the linkage-editor or binder.
During the bind process all external references (for example, calls to sub-
routines and service modules) are resolved. The binder uses information in
the object deck to combine them into a load module.
A load module is an executable program stored in a Partitioned Data Set
(PDS) program library. At program fetch time, the load module produced by
the binder is loaded into virtual storage. When the program is loaded, it then
can be run.
19
Link-Edit Step
20
CICS Program Execution
• The Programs and Maps have already been registered in the PCT and PPT
tables.
• Sign on to CICS.
• Execute CEMT command to refresh the map load and program load in the
PPT table.
21
Starting a TASK
PCT
PCT
TXN1 Trans. Program
TXC1 MAPPGC1
TXC2 MAPPGC2
PPT
TXN1 TXNPGM1 PPT
TXN2 TXNPGM2 Program. Location
CICS Address Space MAPPGC1 In Storage
MAPPGC2 On Disk
TXNPGM1 In Storage
TXNPGM2 On Disk
MAPPGC1
22
Session 2 : Summary
23
THANK YOU
24