Sei sulla pagina 1di 45

CICS, C2 2001, Mike Murach & Associates, Inc.

Slide 1
Chapter 2
Introduction to
CICS
programming
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 2
Objectives
1. Describe the difference between the operation of a conversational
program and the operation of a pseudo-conversational program.
2. Explain why conversational programs are not as efficient as
pseudo-conversational programs.
3. Describe the basic format and coding rules for any CICS command.
4. Briefly describe each of the following: BMS mapset, symbolic
map, event/response chart, and structure chart.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 3
Objectives (continued)
5. Explain the COBOL code required to pass a communication area
from one program execution to the next.
6. Explain the COBOL code used to detect the first execution of a
program in a pseudo-conversational session.
7. Explain the COBOL code used to determine what AID key the user
pressed and to initiate the appropriate response.
8. Explain the COBOL code used to test CICS response codes.
9. Describe the function of each of the CICS commands in this
chapter: SEND MAP, RECEIVE MAP, READ, RETURN, XCTL,
and ABEND.
10. List the 8 steps of CICS program development.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 4
Screen 1
When the program first starts, it displays the customer inquiry map.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 5
Screen 2
The user can then enter a customer number and press the Enter key.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 6
Screen 3
If the customer number is valid, the program retrieves the customer
record and displays the data for that customer on the screen.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 7
Screen 4
To display the data for another customer, the user can type over the
current customer number and then press the Enter key. If the
customer number is invalid, an error message is displayed.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 8
How conversational programming
works
y A conversational program is an online
program that sits idle while it waits for user
input.
y While a conversational program waits for
user input, the task associated with that
program must remain in storage.
y Conversational programs are often the cause
of a CICS condition known as Short on
Storage, or SOS.
Send
first
map
Start
Send
map
Wait
for
input
End? End
Yes
No
Process
data
Receive
map
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 9
Send
first
map
Start
End
Send
map
Wait
for
input
Start
End?
End
Yes
No
Process
data
Receive
map
End
How pseudo-conversational programming works
y A pseudo-conversational
program ends after it sends
data to a terminal, and some
of the resources used by the
program are released.
y CICS restarts the program
when the user completes
anentry and presses one of
the terminals attention
identifier (AID) keys.
y A pseudo-conversational
program requires a different
type of design and logic than
a conversational program.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 10
The general syntax of a CICS command
EXEC CICS
command option(value)...
END-EXEC.
A CICS command that receives data from the
terminal
EXEC CICS
RECEIVE MAP('INQMAP1')
MAPSET('INQSET1')
INTO(INQMAP1I)
END-EXEC.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 11
CICS commands for doing BMS-controlled screen
interactions
RECEIVE MAP Retrieves input data from the terminal.
SEND MAP Sends information to the terminal for display.
CICS commands for passing control from one
program to another
ABEND Transfers control to an abend routine or returns control to CICS.
LINK Invokes a program at a lower level.
RETURN Returns control to CICS or the invoking program.
XCTL Transfers control to another program.
CICS commands for processing VSAM files
DELETE Deletes a record from a file.
READ Retrieves a specified record from a file.
REWRITE Updates a record in a file.
SYNCPOINT Commits or reverses updates made to one or more files.
WRITE Adds a record to a file.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 12
COBOL statements not allowed in CICS programs
Operator communication statements
Accept
Display
File I/O statements
Open
Close
Read
Write
Rewrite
Delete
Start
Other statements
Accept Date/Day/Day-Of-Week/Time
Merge
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 13
Customer inquiry program overview
Program CUSTINQ1: Customer inquiry
Trans-id INQ1
Overview Display customer information from the customer master file based
on customer numbers entered by the user.
Input/output
specifications
CUSTMAS Customer master file
INQMAP1 Customer inquiry map
Processing
specifications
1. Control is transferred to this program via XCTL from the menu
program INVMENU with no communication area. The user can
also start the program by entering the trans-id INQ1. In either
case, the program should respond by displaying the customer
inquiry map.
2. If the user enters a customer number, read the customer record
from CUSTMAS and display it. If the record doesnt exist,
display an error message.
3. If the user presses the Clear key, redisplay the customer inquiry
map without any data.
4. If the user presses PF3 or PF12, return to the menu program
INVMENU by issuing an XCTL command.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 14
The screen layout for the customer inquiry program
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 15
How to create and use a BMS mapset
y A BMS mapset is an assembler language program that defines the
format of the maps that are used by a program.
y After you code a mapset, you assemble it to produce a physical
mapset and a symbolic mapset.
y The physical mapset is used by CICS to determine the location,
appearance, and operation of data thats displayed on a screen.
y The symbolic mapset is a COBOL copy member that allows you
to manipulate the screen data in your COBOL program.
y To code a BMS mapset, you use two assembler commands
(PRINT NOGEN and END) and three macros (DFHMSD,
DFHMDI, and DFHMDF).
y A DFHMSD macro marks the start and end of each mapset.
y A DFHMDI macro marks the beginning of each map.
y A DFHMDF macro defines each field.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 16
The code for the BMS mapset
PRINT NOGEN
INQSET1 DFHMSD TYPE=&SYSPARM, X
LANG=COBOL, X
MODE=INOUT, X
TERM=3270-2, X
CTRL=FREEKB, X
STORAGE=AUTO, X
TIOAPFX=YES
***********************************************************************
INQMAP1 DFHMDI SIZE=(24,80), X
LINE=1, X
COLUMN=1
***********************************************************************
DFHMDF POS=(1,1), X
LENGTH=7, X
ATTRB=(NORM,PROT), X
COLOR=BLUE, X
INITIAL='INQMAP1'
DFHMDF POS=(1,20), X
LENGTH=16, X
ATTRB=(NORM,PROT), X
COLOR=GREEN, X
INITIAL='Customer Inquiry'
TRANID DFHMDF POS=(1,76), X
LENGTH=4, X
ATTRB=(NORM,PROT), X
COLOR=BLUE, X
INITIAL='XXXX'
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 17
The code for the BMS mapset (continued)
***********************************************************************
DFHMDF POS=(3,1), X
LENGTH=42, X
ATTRB=(NORM,PROT), X
COLOR=NEUTRAL, X
INITIAL='Type a customer number. Then press Enter.'
DFHMDF POS=(5,1), X
LENGTH=24, X
ATTRB=(NORM,PROT), X
COLOR=GREEN, X
INITIAL='Customer number. . . . .'
CUSTNO DFHMDF POS=(5,26), X
LENGTH=6, X
ATTRB=(NORM,UNPROT,IC), X
COLOR=TURQUOISE, X
INITIAL='______'
DFHMDF POS=(5,33), X
LENGTH=1, X
ATTRB=ASKIP
***********************************************************************
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 18
The code for the BMS mapset (continued)
DFHMDF POS=(7,1), X
LENGTH=24, X
ATTRB=(NORM,PROT), X
COLOR=GREEN, X
INITIAL='Name and address . . . :'
LNAME DFHMDF POS=(7,26), X
LENGTH=30, X
ATTRB=(NORM,PROT), X
COLOR=TURQUOISE
FNAME DFHMDF POS=(8,26), X
LENGTH=20, X
ATTRB=(NORM,PROT), X
COLOR=TURQUOISE
ADDR DFHMDF POS=(9,26), X
LENGTH=30, X
ATTRB=(NORM,PROT), X
COLOR=TURQUOISE
CITY DFHMDF POS=(10,26), X
LENGTH=20, X
ATTRB=(NORM,PROT), X
COLOR=TURQUOISE
STATE DFHMDF POS=(10,47), X
LENGTH=2, X
ATTRB=(NORM,PROT), X
COLOR=TURQUOISE
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 19
The code for the BMS mapset (continued)
ZIPCODE DFHMDF POS=(10,50), X
LENGTH=10, X
ATTRB=(NORM,PROT), X
COLOR=TURQUOISE
***********************************************************************
MESSAGE DFHMDF POS=(23,1), X
LENGTH=79, X
ATTRB=(BRT,PROT), X
COLOR=YELLOW
DFHMDF POS=(24,1), X
LENGTH=20, X
ATTRB=(NORM,PROT), X
COLOR=BLUE, X
INITIAL='F3=Exit F12=Cancel'
DUMMY DFHMDF POS=(24,79), X
LENGTH=1, X
ATTRB=(DRK,PROT,FSET), X
INITIAL=' '
***********************************************************************
DFHMSD TYPE=FINAL
END
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 20
The symbolic map definition
y The fields in a symbolic map represent the data thats sent to and
received from a terminal by a COBOL program.
y You use a Copy statement to copy the symbolic map into the
Working-Storage Section of your program.
y A symbolic map includes two 01-level items that occupy the same
storage space: one for input and one for output.
y For each input field in the mapset (I), the symbolic map contains a
length field (L), a change field (F), and an attribute field (A).
y For each output field (O), the symbolic map contains a Picture for
the output data, which can be different from the picture for the
input field.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 21
The code for the symbolic map
01 INQMAP1I.
03 FILLER PIC X(12).
03 TRANIDL PIC S9(4) COMP.
03 TRANIDF PIC X.
03 FILLER REDEFINES TRANIDF.
05 TRANIDA PIC X.
03 TRANIDI PIC X(4).
03 CUSTNOL PIC S9(4) COMP.
03 CUSTNOF PIC X.
03 FILLER REDEFINES CUSTNOF.
05 CUSTNOA PIC X.
03 CUSTNOI PIC X(6).
03 LNAMEL PIC S9(4) COMP.
03 LNAMEF PIC X.
03 FILLER REDEFINES LNAMEF.
05 LNAMEA PIC X.
03 LNAMEI PIC X(30).
03 FNAMEL PIC S9(4) COMP.
03 FNAMEF PIC X.
03 FILLER REDEFINES FNAMEF.
05 FNAMEA PIC X.
03 FNAMEI PIC X(20).
03 ADDRL PIC S9(4) COMP.
03 ADDRF PIC X.
03 FILLER REDEFINES ADDRF.
05 ADDRA PIC X.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 22
The code for the symbolic map (continued)
03 ADDRI PIC X(30).
03 CITYL PIC S9(4) COMP.
03 CITYF PIC X.
03 FILLER REDEFINES CITYF.
05 CITYA PIC X.
03 CITYI PIC X(20).
03 STATEL PIC S9(4) COMP.
03 STATEF PIC X.
03 FILLER REDEFINES STATEF.
05 STATEA PIC X.
03 STATEI PIC X(2).
03 ZIPCODEL PIC S9(4) COMP.
03 ZIPCODEF PIC X.
03 FILLER REDEFINES ZIPCODEF.
05 ZIPCODEA PIC X.
03 ZIPCODEI PIC X(10).
03 MESSAGEL PIC S9(4) COMP.
03 MESSAGEF PIC X.
03 FILLER REDEFINES MESSAGEF.
05 MESSAGEA PIC X.
03 MESSAGEI PIC X(79).
03 DUMMYL PIC S9(4) COMP.
03 DUMMYF PIC X.
03 FILLER REDEFINES DUMMYF.
05 DUMMYA PIC X.
03 DUMMYI PIC X(1).
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 23
The code for the symbolic map (continued)
01 INQMAP1O REDEFINES INQMAP1I.
03 FILLER PIC X(12).
03 FILLER PIC X(3).
03 TRANIDO PIC X(4).
03 FILLER PIC X(3).
03 CUSTNOO PIC X(6).
03 FILLER PIC X(3).
03 LNAMEO PIC X(30).
03 FILLER PIC X(3).
03 FNAMEO PIC X(20).
03 FILLER PIC X(3).
03 ADDRO PIC X(30).
03 FILLER PIC X(3).
03 CITYO PIC X(20).
03 FILLER PIC X(3).
03 STATEO PIC X(2).
03 FILLER PIC X(3).
03 ZIPCODEO PIC X(10).
03 FILLER PIC X(3).
03 MESSAGEO PIC X(79).
03 FILLER PIC X(3).
03 DUMMYO PIC X(1).
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 24
An event/response chart for the customer inquiry
program
Event Response
Start the program Display the customer map.
Enter key Receive the customer map.
Edit the customer number.
If valid
read the record.
If the record exists
display it.
If the number isnt valid or the record doesnt exist
display an error message.
PF3 or PF12 Return to the menu program.
Clear key Redisplay the customer map without any data.
Any PA key Ignore the key.
Any other key Display an error message.
y An event/response chart summarizes each user action (event) and
the programs response to that event.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 25
The structure chart for the customer inquiry
program
Description
y A program structure chart specifies the overall program structure.
y For a pseudo-conversational program, the top-level module must
determine what processing is to be done each time its executed.
y The processing options are identified by the modules in the second
level of the chart.
Process
customer
inquiry
Process
customer
map
Edit
customer
data
Get
customer
record
Receive
customer
map
Send
customer
map
Send
customer
map
0000
1000 1400
1100 1200 1300 1400
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 26
Two of the fields in the Execute Interface Block
01 DFHEIBLK.
.
.
02 EIBCALEN PIC S9(4) COMP.
02 EIBAID PIC X(1).
.
.
Description
y
The Execute Interface Block (EIB) is a CICS area that contains
information related to the current task. The definition of this area
is inserted into the Linkage Section of the program when the
program is prepared for execution.
y
The EIBCALEN field contains the length of the data passed to the
program through its communication area (DFHCOMMAREA).
y
The EIBAID field indicates the AID key the user pressed to
restart the program.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 27
The DFHAID copy member
01 DFHAID.
02 DFHNULL PIC X VALUE IS ' '.
02 DFHENTER PIC X VALUE IS ''''.
02 DFHCLEAR PIC X VALUE IS '_'.
02 DFHCLRP PIC X VALUE IS '('.
02 DFHPEN PIC X VALUE IS '='.
02 DFHOPID PIC X VALUE IS 'W'.
02 DFHMSRE PIC X VALUE IS 'X'.
02 DFHSTRF PIC X VALUE IS 'h'.
02 DFHTRIG PIC X VALUE IS '''.
02 DFHPA1 PIC X VALUE IS '%'.
02 DFHPA2 PIC X VALUE IS ''.
02 DFHPA3 PIC X VALUE IS ','.
02 DFHPF1 PIC X VALUE IS '1'.
02 DFHPF2 PIC X VALUE IS '2'.
02 DFHPF3 PIC X VALUE IS '3'.
.
02 DFHPF12 PIC X VALUE IS '@'.
.
Description
y The DFHAID copy member contains literal values that
correspond to the AID keys that the user can press.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 28
The customer inquiry program
IDENTIFICATION DIVISION.
*
PROGRAM-ID. CUSTINQ1.
*
ENVIRONMENT DIVISION.
*
DATA DIVISION.
*
WORKING-STORAGE SECTION.
*
01 SWITCHES.
*
05 VALID-DATA-SW PIC X VALUE 'Y'.
88 VALID-DATA VALUE 'Y'.
*
01 FLAGS.
*
05 SEND-FLAG PIC X.
88 SEND-ERASE VALUE '1'.
88 SEND-DATAONLY VALUE '2'.
88 SEND-DATAONLY-ALARM VALUE '3'.
*
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 29
The customer inquiry program (continued)
01 COMMUNICATION-AREA PIC X.
*
01 RESPONSE-CODE PIC S9(8) COMP.
*
01 CUSTOMER-MASTER-RECORD.
*
05 CM-CUSTOMER-NUMBER PIC X(6).
05 CM-FIRST-NAME PIC X(20).
05 CM-LAST-NAME PIC X(30).
05 CM-ADDRESS PIC X(30).
05 CM-CITY PIC X(20).
05 CM-STATE PIC X(2).
05 CM-ZIP-CODE PIC X(10).
*
COPY INQSET1.
*
COPY DFHAID.
*
LINKAGE SECTION.
*
01 DFHCOMMAREA PIC X.
*
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 30
The customer inquiry program (continued)
PROCEDURE DIVISION.
*
0000-PROCESS-CUSTOMER-INQUIRY.
*
EVALUATE TRUE
*
WHEN EIBCALEN = ZERO
MOVE LOW-VALUE TO INQMAP1O
MOVE 'INQ1' TO TRANIDO
SET SEND-ERASE TO TRUE
PERFORM 1400-SEND-CUSTOMER-MAP
*
WHEN EIBAID = DFHCLEAR
MOVE LOW-VALUE TO INQMAP1O
MOVE 'INQ1' TO TRANIDO
SET SEND-ERASE TO TRUE
PERFORM 1400-SEND-CUSTOMER-MAP
*
WHEN EIBAID = DFHPA1 OR DFHPA2 OR DFHPA3
CONTINUE
*
WHEN EIBAID = DFHPF3 OR DFHPF12
EXEC CICS
XCTL PROGRAM('INVMENU')
END-EXEC
*
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 31
The customer inquiry program (continued)
WHEN EIBAID = DFHENTER
PERFORM 1000-PROCESS-CUSTOMER-MAP
*
WHEN OTHER
MOVE LOW-VALUE TO INQMAP1O
MOVE 'Invalid key pressed.' TO MESSAGEO
SET SEND-DATAONLY-ALARM TO TRUE
PERFORM 1400-SEND-CUSTOMER-MAP
*
END-EVALUATE.
*
EXEC CICS
RETURN TRANSID('INQ1')
COMMAREA(COMMUNICATION-AREA)
END-EXEC.
*
1000-PROCESS-CUSTOMER-MAP.
*
PERFORM 1100-RECEIVE-CUSTOMER-MAP.
PERFORM 1200-EDIT-CUSTOMER-DATA.
IF VALID-DATA
PERFORM 1300-GET-CUSTOMER-RECORD
END-IF.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 32
The customer inquiry program (continued)
IF VALID-DATA
SET SEND-DATAONLY TO TRUE
PERFORM 1400-SEND-CUSTOMER-MAP
ELSE
SET SEND-DATAONLY-ALARM TO TRUE
PERFORM 1400-SEND-CUSTOMER-MAP
END-IF.
*
1100-RECEIVE-CUSTOMER-MAP.
*
EXEC CICS
RECEIVE MAP('INQMAP1')
MAPSET('INQSET1')
INTO(INQMAP1I)
END-EXEC.
*
1200-EDIT-CUSTOMER-DATA.
*
IF CUSTNOL = ZERO
OR CUSTNOI = SPACE
MOVE 'N' TO VALID-DATA-SW
MOVE 'You must enter a customer number.' TO MESSAGEO
END-IF.
*
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 33
The customer inquiry program (continued)
1300-GET-CUSTOMER-RECORD.
*
EXEC CICS
READ FILE('CUSTMAS')
INTO(CUSTOMER-MASTER-RECORD)
RIDFLD(CUSTNOI)
RESP(RESPONSE-CODE)
END-EXEC.
*
EVALUATE RESPONSE-CODE
WHEN DFHRESP(NORMAL)
MOVE SPACE TO MESSAGEO
MOVE CM-LAST-NAME TO LNAMEO
MOVE CM-FIRST-NAME TO FNAMEO
MOVE CM-ADDRESS TO ADDRO
MOVE CM-CITY TO CITYO
MOVE CM-STATE TO STATEO
MOVE CM-ZIP-CODE TO ZIPCODEO
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 34
The customer inquiry program (continued)
WHEN DFHRESP(NOTFND)
MOVE 'N' TO VALID-DATA-SW
MOVE 'That customer does not exist.' TO MESSAGEO
MOVE SPACE TO LNAMEO
FNAMEO
ADDRO
CITYO
STATEO
ZIPCODEO
WHEN OTHER
EXEC CICS
ABEND
END-EXEC
END-EVALUATE.
*
1400-SEND-CUSTOMER-MAP.
*
EVALUATE TRUE
WHEN SEND-ERASE
EXEC CICS
SEND MAP('INQMAP1')
MAPSET('INQSET1')
FROM(INQMAP1O)
ERASE
END-EXEC
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 35
The customer inquiry program (continued)
WHEN SEND-DATAONLY
EXEC CICS
SEND MAP('INQMAP1')
MAPSET('INQSET1')
FROM(INQMAP1O)
DATAONLY
END-EXEC
WHEN SEND-DATAONLY-ALARM
EXEC CICS
SEND MAP('INQMAP1')
MAPSET('INQSET1')
FROM(INQMAP1O)
DATAONLY
ALARM
END-EXEC
END-EVALUATE.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 36
The syntax of the SEND MAP command
EXEC CICS
SEND MAP(map-name)
[MAPSET(mapset-name)]
[FROM(data-name)]
[MAPONLY | DATAONLY]
[ERASE]
[ALARM]]
END-EXEC
A SEND MAP command that sends only the data
from the symbolic map
EXEC CICS
SEND MAP('INQMAP1')
MAPSET('INQSET1')
FROM(INQMAP1O)
DATAONLY
END-EXEC.
Description
y The SEND MAP command sends the data from a map within a
mapset to a terminal.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 37
The syntax of the RECEIVE MAP command
EXEC CICS
RECEIVE MAP(map-name)
[MAPSET(mapset-name)]
INTO(data-name)
END-EXEC
A typical RECEIVE MAP command
EXEC CICS
RECEIVE MAP('INQMAP1')
MAPSET('INQSET1')
INTO(INQMAP1I)
END-EXEC.
Description
y The RECEIVE MAP command receives data from the terminal
and maps it into the symbolic map.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 38
The syntax of the READ command
EXEC CICS
READ FILE(filename)
INTO(data-name)
RIDFLD(data-name)
[RESP(response-code)]
END-EXEC
Description
y The READ command retrieves a record from a VSAM file.
y The RESP option returns a response code that indicates if the
operation was successful or whether an exceptional condition
occurred.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 39
A READ command that reads a record from a key-
sequenced file
EXEC CICS
READ FILE('CUSTMAS')
INTO(CUSTOMER-MASTER-RECORD)
RIDFLD(CUSTNOI)
RESP(RESPONSE-CODE)
END-EXEC.
An If statement that tests the response code after
a read operation
IF RESPONSE-CODE = DFHRESP(NORMAL)...
Description
y You can use the DFHRESP keyword to test the response code for
specific conditions.
y If a READ command is successful, the NORMAL condition
occurs. If the record cant be found, the NOTFND condition
occurs.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 40
The syntax of the RETURN command
EXEC CICS
RETURN [TRANSID(trans-id)]
[COMMAREA(data-name)]
END-EXEC
A RETURN command that sets up the next
execution of a program
EXEC CICS
RETURN TRANSID(INQ1)
COMMAREA(COMMUNICATION-AREA)
END-EXEC.
Description
y The RETURN command ends the program, but if you specify the
TRANSID option, CICS invokes that trans-id the next time the
user presses an AID key.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 41
The syntax of the XCTL command
EXEC CICS
XCTL PROGRAM(program-name)
END-EXEC
An XCTL command that invokes a program named
INVMENU
EXEC CICS
XCTL PROGRAM('INVMENU')
END-EXEC.
Description
y The XCTL command passes control to another CICS program.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 42
The syntax of the ABEND command
EXEC CICS
ABEND [NODUMP]
END-EXEC
An ABEND command that doesnt produce a
storage dump
EXEC CICS
ABEND NODUMP
END-EXEC.
Description
y The ABEND command terminates the program abnormally.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 43
An eight-step procedure for developing a CICS
program
Analysis and design
1. Develop a complete set of program specifications.
2. Design the program using an event/response chart and a structure
chart.
Implementation
3. Prepare the BMS mapset.
4. Code the program.
5. Prepare the program for execution.
6. Create the necessary CICS table entries.
7. Test the program under CICS.
Documentation
8. Document the program.
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 44
A CICS program preparation procedure
y Before you compile a CICS
program, you must translate it.
y The CICS translator converts
the CICS commands to Move
and Call statements that can be
compiled by the COBOL
compiler.
y The translator also inserts code
into your program that it needs
to operate under CICS.
y After you translate the program,
you compile and link-edit it just
as you would any other COBOL
program.
Translated program
COBOL compiler
Object module
Linkage editor
Load module
Copy libraries
Object libraries
Compiler output
Linkage editor
output
Source program
CICS translator
CICS, C2 2001, Mike Murach & Associates, Inc. Slide 45
Translated code for a CICS READ command
* EXEC CICS
* RECEIVE MAP('INQMAP1')
* MAPSET('INQSET1')
* INTO(INQMAP1I)
* END-EXEC.
MOVE '..}............00109 ' TO DFHEIV0
MOVE 'INQMAP1' TO DFHC0070
MOVE 'INQSET1' TO DFHC0071
CALL 'DFHEI1' USING DFHEIV0 DFHC0070 INQMAP1I DFHDUMMY
DFHC0071.

Potrebbero piacerti anche