Ritesh Dubal Merrill Lynch USA Customer Information Control System
Ritesh DubalMerrill Lynch USA
Customer Information Control System
1. Different ways of initiating a transaction.
2. Structure of CICS-COBOL programs.
3. Steps involved in developing CICS-COBOL programs.
4. BMS and its functions.
5. BMS Macros.
Agenda for Day 2
6. Development and execution of mapsets.
1. By submitting a JCL. Runs SIP which uses SIT.
2. By a transaction identifier entered at the terminal.
3. By a transaction identifier associated with a terminal for pseudo-conversation.
4. By the START command which initiates for transaction specified in the parameter.
5. By Automatic Task Initiation (ATI).
6. By an Aid key associated with the transaction in PCT.
Different Ways of Initiating a Transaction
A CICS - COBOL program is COBOL program embedding CICS commands
for DB/DC operations.
1. Only PROGRAM-ID is mandatory in the IDENTIFICATION DIVISION.
2. No ENVIRONMENT DIVISION. (Why?)
3. No FILE SECTION in the DATA DIVISION. (Why?)
4. No file related verbs such as OPEN, START, READ, WRITE, REWRITE,
DELETE, CLOSE, etc,. (Why?)
Structure of a CICS Program (1 of 2)
5. No verbs requesting GETMAIN such as ACCEPT, DISPLAY, SORT
STRING, UNSTRING, EXAMINE, INSPECT, EXHIBIT, etc.,
6. No verbs requesting system services such as STOP RUN, COUNT, etc.,
7. A called program can not have CICS commands or inhibited COBOL
statements.
Structure of a CICS Program (2 of 2)
EXEC CICS function
option 1 (argument 1)
option 2 (argument 2)
. . . . . . . . . . . . .
END-EXEC
CICS Command Format
EXEC CICS SEND [TEXT] FROM (dataname) LENGTH (length-of-dataname) [ERASE] [FREEKB] [ALARM]END-EXEC
EXEC CICS RECEIVE INTO (data-name) LENGTH (length-of-dataname)END-EXEC
Basic CICS Commands (1 of 2)
EXEC CICS SEND CONTROL CURSOR (data-value)
. . .END-EXEC
EXEC CICS RETURNEND-EXEC
Basic CICS Commands (1 of 2)
Step 1. Open a tso session.Step 2. Create a new PDS.Step 3. Code the following program in a new member.
CICS Hello World Program Development (1 of 3)
Step 4. Compile the program using the macro “TRNGCICS”.
CICS Hello World Program Development (2 of 3)
Step 5. Open a CICS Session.
Step 6. Install the program using the command
CEMT SET PROG(program-name) NEW.
Step 7. Associate a transaction-id with the program
in PCT. Note that transaction-ids are unique
in the system.
CICS Hello World Program Development (3 of 3)
Step1: Open an EP Client session for Mainframe, type CICS3 and hit ENTER key. Enter your User id and Password and press the ENTER Key.
Execution the Hello World Program (1 of 2)
Step 2: You’ll find a blank screen as shown below. Type the transaction-id. To Sign off, you can use the transaction CESF logoff.
Execution the Hello World Program (1 of 2)
JCL is not required to run a CICS application program
It is prepared for the CICS job itself by the system’s
administrator. Once CICS job starts, this job is considered
as one CICS region, under which more than application
program can be executed simultaneously.
What about JCL for CICS Program?
Basic Mapping Support (BMS) is a standard facility
available in CICS that allows development and
manipulation of formatted screens.
The primary objective of BMS is to free the application
programs from the burden of dealing with NMDS.
BMS
1. Removal of device dependent code from the application
programs by placing them in the map.
2. Removal of constant information like titles, labels, etc
from the application programs by placing them in the map.
3. Removal of format dependent code from the application programs.
4. Construction of NMDS required to produce the desired screen.
5. Providing text handling capability.
Functions of BMS
A Mapset is a collection of one or more maps coded
and linkedited together. It is a program written in
Assembly Language.
A Map is a representation of one screen format. It is a
program written in assembly language.
Map and Mapset
SCR1 MAIN MENU DATE: 14/11/2001 TIME: 10:15:15
1. EMPLOYEE RECORD MAINTENANCE
2. EMPLOYEE DETAILS BROWSE
3. EXIT
SELECTION : - (1/2/3)
Your Choice Please
F1 – Help F3 – Exit ENTER - Process
Sample Formatted Screen
1. Physical Map: Contains the executables to do each of the following.
(a) Build the screen, with all the titles and labels in the proper places on the screen and with proper attributes.
(b) Merge the data from the application program in the proper places on the screen.
(c) Extract the data for the application program when the screen is received.
Physical Map and Symbolic Map (1 of 2)
2. Symbolic Map: Defines the map fields in the appropriate
language used to store the variable data referenced by the
application programs.
Physical Map and Symbolic Map (2 of 2)
1. DFHMSD ( MapSet Definition )
2. DFHMDI ( Map DefInition )
3. DFHMDF ( Map Defined Field )
BMS Macros
MMYXXY DFHMSD TYPE=DSECT/MAP/&SYSPARM/FINAL,
MODE=IN/OUT/INOUT,
LANG=ASM/COBOL/PL1,
STORAGE=AUTO/BASE=name,
CTRL=(PRINT,FREEKB,ALARM,FRSET),
MAPATTS=(COLOR,HIGHLIGHT,.......),
TERM=terminal type,
HIGHLIGHT=OFF/BLINK/REVERSE/UNDERLINE,
TIOAPFX=YES/NO
Note: For each parameter, you have to choose one of the options available.
The underlined options are defaults values.
DFHMSD Macro and its Parameters
TYPE=DSECT/MAP/&SYSPARM/FINAL
TYPE governs whether the assembly produces the physical
map or the symbolic description or both.
1. DSECT: Creates the Symbolic map.
2. MAP: Creates Physical map.
3. &SYSPARM: Creates both symbolic & physical maps.
4. FINAL: Mapset definition ends. No more map related
commands later.
DFHMSD Macro – TYPE Parameter
MODE=IN/OUT/INOUT
TYPE specifies whether the map is used for receiving data or
sending data or both to the terminal
1. IN : For receiving data.
2. OUT: For sending data.
3. INOUT: For both receiving and sending data.
DFHMSD Macro – MODE Parameter
LANG=ASM/COBOL/PL1
LANG specifies the language in which the application program
will be coded so that an appropriate symbolic map may be
generated.
1. ASM: For assembly language.
2. COBOL: For COmmon Business Oriented Language.
3. PL1: For Programming Language 1.
DFHMSD Macro – LANG Parameter
STORAGE=AUTO/BASE=name
STORAGE specifies the storage locations can be re-used or not.
1. AUTO: Every map in the mapset has it’s own storage area.
This is ideal for beginners.
2. BASE= MAP1. This causes an amount of memory necessary
for MAP1 to be allocated for entire mapset. All other maps are
overlaid in this area. If you use this option, you have to take care
of storing the required data in the map area, the map area, before
receiving the next map.
DFHMSD Macro – STORAGE Parameter
CTRL=(PRINT, FREEKB, ALARM, FRSET)
Control parameter defines the screen and keyboard control information that you want to send along with a map.
1. PRINT: Map must be sent to the printer.
2. FREEKB: Free the keyboard.
3. ALARM: Alarm (beep) when map is sent to the user.
4. FSET/FRSET: Set/Re-set MDT tag.
DFHMSD Macro – CTRL Parameter
TERM=terminal type, SUFFIX=n
This decides the terminal type, on which the screen is to be
displayed. We must code TERM=3270.
DFHMSD Macro – TERM Parameter
TIOAPFX=YES/NO
This decides whether command level CICS or macro level CICS
is being utilized respectively. We are using command level
CICS. Hence code TIOAPFX=YES.
DFHMSD Macro – TIOAPFX Parameter
MMYXXY DFHMSD TYPE=&SYSPARM, X
MODE=INOUT, X
LANG=COBOL, X
STORAGE=AUTO, X
CTRL=(FREEKB,FRSET), X
TERM=3270, X
TIOAPFX=YES-
---
DFHMSD TYPE=FINAL
END
DFHMSD Macro – CTRL Parameter
BreakBreak
MAPNAME DFHMDI SIZE=(LINE,COLUMN),
LINE=Line number,
COLUMN=Column number,
CTRL=(PRINT,FREEKB,ALARM,FRSET),
TIOAPFX=YES/NO
Note: CTRL and TIOAPFX are either coded either at the mapset
level or at the map level but not at the map level.
DFHMDI Macro and its Parameters
MMLXXY DFHMSD TYPE=&SYSPARM, X
MODE=INOUT, X
LANG=COBOL, X
STORAGE=AUTO, X
CTRL=(FREEKB,FRSET), X
TERM=3270, X
TIOAPFX=YES
MAPNAME DFHMDI SIZE=(24,80), X
LINE=01, X
COLUMN=01
- -
--
DFHMSD TYPE=FINAL
END
Consolidated Mapset
Fieldname DFHMDF POS=(line,column), X
LENGTH=number, X
INITIAL=‘text’, X
JUSTIFY=(LEFT/RIGHT,BLANK/ZERO), X
ATTRB=(ASKIP/PROT/UNPROT,NUM, BRT/NORM/DRK, IC, FSET), X
PICIN=‘value’, X
PICOUT=‘value’, X
MAPATTS=(COLOR,HIGHLIGHT,.......), X
HIGHLIGHT=OFF/BLINK/REVERSE/UNDERLINE
DFHMDF Macro and its Parameters
MBLXXY DFHMSD TYPE=&SYSPARM, X
CTRL=(FREEKB,FRSET),LANG=COBOL, X
STORAGE=AUTO, TERM=3270, X
MODE=INOUT,TIOAPFX=YES
MAINMAP DFHMDI SIZE=(24,80), X
LINE=01, X
COLUMN=01
DFHMDF POS=(12,19), X
LENGTH=36, X
INITIAL=‘MAIN MENU’, X
ATTRB=(PROT,NORM) -
- DFHMSD TYPE=FINAL
END
Complete Mapset
This is flag in the attribute.
Every field in the map has an attribute associated with it.
MDT tag in the attribute, identifies whether data in the field needs to be transferred to the system or not. (The idea behind calling it a modified data tag is that - only modified data will be transferred, not the unchanged data.)
Attribute stores data relevant to the field like - color, intensity, modified or not etc.
Modified Data Tag (MDT)
0 1 2 3 4 5 6 7
Protection and Shift Intensity MDT
Bit Positions Functions Bit Settings0 and 1 Determined by contents of bits 2 - 72 and 3 Protection and Shift 00 = Unprotected Alphanumeric
01 = Unprotected Numeric10 = Protected Stop11 = Protected Skip
4 and 5 Intensity 00 = Normal01 = Normal10 = Bright11 = No-display ( Dark )
6 Must be Zero Always7 Modified Data Tag 0 = Field has not been modified
1 = Field has been modified
Attribute byte of a Field
Generally, for all fields, MDT is OFF - initially.
When user modifies the contents in a field, the MDT tag is automatically set.
Program may modify the attribute byte in the symbolic map, before sending the screen to the user, and set MDT.
Data is transferred from all fields where MDT is ON (set).
If MDT is OFF (Reset), data from that field is not transferred to the system.
When is MDT set on?
1. For all constant fields, specify ASKIP.
2. For all variable fields where user can enter data, specify
UNPROT and code a skipper or stopper field at the end.
3. For all variable fields where user can not enter data, specify PROT and code a skipper or stopper field at the end.
4. Skipper is a single byte field with ASKIP as ATTRB.
5. Stopper is a single byte field with PROT as ATTRB.
General Guidelines for coding DFHMDF Macro
1. Code the mapset, map and field names in column 1.
2. Code the macro name (DFHMSD, DFHMDI and
DFHMDF) in columns 9 through 14. (END goes in
columns 9, 10 and 11).
3. Code the parameters in columns 16 through 71.
4. Separate the parameters by one comma (no space).
5. To improve readability, code each parameter on a separate line.
Mapset Coding Rules (1 of 2)
6. If a parameter requires more than one line, then code as much
as you can in one line and simply continue from column 16 in
the next line.7. An exception to Rule 6 is the INITIAL parameter. Code INITIAL
, = sign, opening quote and at least one character in the first line
and continue the string in columns 16 through 71 in the succeeding
lines.
9. Enclose INTIAL values within quotes. If you need the quote symbol
then type two quotes together. Do the same for & symbol also.
8. Use ‘x’ as the continuation character in column 72.
Mapset Coding Rules (2 of 2)
EXEC CICS SEND MAP(map-name) MAPSET(mapset-name) [DATAONLY] [MAPONLY] [CURSOR(position)] [ERASE / ERASEUP ] [PRINT] [FREEKB] [ALARM] [FRSET]END-EXEC
CICS Command for Formatted Input
EXEC CICS RECEIVE MAP(map-name) MAPSET(mapset-name) INTO(ws-data-area) FROM(ws-data-area) LENGTH(data-value)END-EXEC
CICS Command for Formatted Output
1. Using the IC option in the mapset.
2. Using the CURSOR option in the SEND MAP.
3. Using the length attribute of the field with SEND MAP.
Positioning a Cursor
1. Create a new PDS.
2. Open a new member and code the mapset.
3. Save the mapset and assemble it using the macro “trngbms”.
4. Open a CICS session.
5. Install the mapset using the command
CEMT SET PROG(mapset-name) NEW.
6. Send the required map to the screen using the command
CECI SEND MAP(map-name) MAPSET(mapset-name) ERASE FREEKB.
Sample Mapset development