You are on page 1of 8

Introduction to BMS in CICS

Customer Information Control System -CICS developed in late 1960s as a DB/DC control system.CICS provides an interface between the Operating System and application programs, it is a transaction management system that can be used on a variety of operating systems not only OS/390, but MVS, VSE, UNIX, Windows and others too. It is a data (base) communications system that provides the user access to online business systems and data with security. CICS can be classed as middleware, or acting as an application server to user applications, providing the customer services to help them implement online business applications.

1) Basic Mapping Support :


In online systems, formatted screens are used. In order to display formatted screen, a terminal (e.g. 3278) must receive a series of data stream called Native Mode Data Stream (NMDS) based on the hardware protocol; this NMDS is a mixture of Buffer Control Characters (BCCs) and text data. NMDS is designed for a particular terminal and is thus both device dependent and format dependent.So if NMDS is used, re-coding is required whenever there is change in the terminal device or screen format. To remove this device and format dependency from application program, CICS provides a facility called Basic MappingSupport (BMS). CICS provides a facility called Basic Mapping Support to create screen formats that can display information and accept user input and send it to the mainframe for processing. It is an interface between Cics Applications Programs and devices,including printers.

1.1) Topics in BMS :


a) Map and Map set b) Physical and Symbolic Map c) Map Definition Macros

1.2) Primary Functions of BMS :


a) b) c) d) e) f) g) h) Removal of device dependent codes from Application Program. Removal of constant information from Application program (Headers, Titles...). Construct NMDS - Native Mode Data Stream. Text handling. Terminal Paging & Message routing. Contents of the screen defined through BMS is called Map. Map is a program written in assembly language. BMS macros are available for Map coding.

i) The BMS Macros are coded in the form of Maps, and Map sets to define the Screen attributes, screen field positions, and field characteristics.

2) Map and Mapset :


a) Representation of one screen format is called Map (screenpanel). b) One or more maps, link edited together, makes up a Mapset(load module). c) Map set must have a entry in PPT as given below: DFHPPT TYPE=ENTRY, MAPSET=name or DFHPPT TYPE=ENTRY,PROGRAM=name Map set name has two parts: a) Generic name 1- 7 chars. Used in App. Program. b) Suffix 1 char. To identify the device type c) Multimap Panel d) Dynamically constructing a screen panel with multiple maps at the execution time e) The concepts of map and mapset can be utilized in two type of cases as given below: Case 1: A mapset consist of a single map. For e.g. MAPSET1 MAPNUM1 Case 2: A mapset consists of several maps. For e.g. MAPSET2 MAPNUM1 MAPNUM2

2.1) Types of Maps :


There are 2 types of MAPS a) Physical Map: Physical Map is a map used by CICS (CSECT) Ensure device independence in the application program BMS macro coding ==> Assembly==> Link edit ==> Load module ==> LOADLIB ===> To be used by CICS b) Symbolic Map: Ensure device and format independence in the application program Symbolic Map is a map used by Application Program (DSECT) BMS macro coding ==> Assembly ==> Symbolic map definition ==> COPYLIB ==> Copied (COPY) into CICS application program.

2.2) Example Symbolic Map :


01 EMPRECI. 02 FILLER PIC X(12). 02 EMPNAL PIC S9(4) COMP. 02 EMPNAF PIC X. 02 FILLER REDEFINES EMPNAF. 03 EMPNAA PIC X. 02 EMPNAI PIC X(21). 01 EMPRECO REDEFINES EMPRECI. 02 FILLER PIC X(12). 02 FILLER PIC X(03). 02 EMPNAO PIC X(21).

3) Physical Map :
a) The BMS macros are assembled and link-edited into CICS load library to create the physical map. The mapset like any other CICS program is stored in CICS runtime library the PPT(Program Processing Table). At the program execution time the physical map is being used by CICS to load the screen image. b) In case of input operations, the physical map defines the maximum length, the starting position for each field to be read and allows BMS to interpret an input NMDS. c) In case of output operations, the physical map defines the starting position, length, field characteristics and the default data for each field and allows BMS to construct an output NMDS.

4) Symbolic Map :
a) The symbolic map is coded using the BMS macro, assembled separately and catalogued into a copy library. The symbolic map serves as a DSECT for referencing the Terminal Input/Output Area(TIOA). The program issues a COBOL COPY statement to include it in the program. b) The symbolic maps represents the actual data structure of the fields defined in the physical map, and is used by the application program to send and receive information from the terminal, in the CICS SEND-MAP & RECEIVE MAP commands. c) The symbolic map can be used by the CICS application programs to dynamically to alter the field attributes, modify screen cursor position, and highlight , protect , unprotect specific fields on the screen. Receive Map Command :
EXEC CICS MAPNAME(MAP name) MAPSET(mapset-name)

INTO(data-area) FROM(data-area) ASIS END-EXEC.

The Receive Map Command is used to receive a map from a terminal. -Exception Condition is MAPFAIL. Send Map Command:
EXEC CICS SEND (MAP name) MAPSET (mapset-name) DATAONLY/MAPONLY FROM (data-area) LENGTH (data-value) ALARM CURSOR (data-value) ERASE ERASEUP FREEKB FRSET END-EXEC

5) Map definition Macros :


Column Number 1 16 Setname Operation Operands Example
EMPMAP DFHMSD TYPE=MAP, MODE=INOUT, LANG=COBOL, STORAGE=AUTO, TIOAPFX=YES

72 Contd.
X X X X

5.1) Explanations :
a) SETNAME : Name of the mapset. Used in CICS command to read or write one of the maps in the mapset. It is the load module name. b) OPERATION : Macro identifier. Mapset/Map/Field definition. c) OPERANDS : Optional key words (parameters) separated by comma. d) CONTD : Current line can be continued by leaving this column non-blank (usually X) and the next line have to be started in 16th column. e) COMMENTS : * in column 1 makes the line comment. f) INITIAL VALUES : Always surround initial values by single quote marks g) ESCAPE CHARS : and &

6) Order of Macros :
DFHMSD TYPE=DSECT DFHMDI DFHMDF DFHMDF DFHMDI DFHMDF DFHMDF DFHMSD TYPE=FINAL END Mapset Map A field A field: Map A field A field: Mapset

6.1) DFHMSD Macro :


The DFHMSD macro is used to define a mapset (TYPE=MAP) and its characteristics or to end a mapset definition (TYPE=FINAL). Only one mapset is allowed in one assembly run. All the maps in a map set get assembled together, and they're loaded together at execution time.
Example: TSTMSET DFHMSD TYPE=&SYSPARM, MODE=INOUT, LANG=COBOL, STORAGE=AUTO, TIOAPFX=YES, CNTL=(FREEKB,FRSET,PRINT) X X X X X

OPTIONS: TYPE= DSECT MAP &SYSPARM FINAL MODE= IN OUT INOUT STORAGE = AUTO BASE

To define the map type For symbolic map For physical map For special assembly procedure To indicate the end of a mapset Coding To indicate input/output operations For an input map only For an output map only For maps involving both input and output. To acquire a separate symbolic map area for each mapset To have the same storage base for the symbolic maps of from More than One mapset

TIOAPFX= YES

To reserve the prefix space (12 bytes) for BMS commands to Acess TIOA Properly required for the CICS command level. To define the device control requests To unlock the keyboard To reset MDT to zero status To set an alarm at screen display time To indicate the mapset to be sent to the printer This ensures device independence, required if other than 3270 Terminal is being used. To specify the user provided suffix number. This must correspond to the TCT parameter.

CNTL= FREEKB FRSET ALARM PRINT TERM=type SUFFIX=nn

6.2) DFHMDI Macro :


Defines a map and its characteristics Example: EMPMAP DFHMDI SIZE=(ll,cc), LINE=nn, COLUMN=mm, JUSTIFY=LEFT/RIGHT X X X

Options : SIZE=(ll,cc) LINE COLUMN JUSTIFY

To define the size of the map by the line size (ll) and the column Size(cc).Useful When the screen contains. Indicates the starting line number of the map. Indicates the starting column number of the map. To specify the entire map (map fields) is to be left or right justified.

6.3) DFHMDF Macro :


The DFHMDF macro is used to define a field in a map and its characteristics. This is the position on the screen where the field should appear. It's the position relative to the beginning of the map. Field starts with its attribute byte, so if POS=(1,1) is coded, then the attribute byte for that field is on line 1 in column 1, and the actual data starts in column 2. The length of the field (not counting the attribute byte) is specified. Literals can be specified within quotes; these character data is for an output field. It is used to define labels and titles for the screen and keep them independent of the program. The above defines the screen layout as given below: ITEM NUMBER

:&nnnnnnnn Where & n _ Is the Attribute character Is unprotected numeric Is Cursor

Define a field and its characteristics Example:


DFHMDF POS(ll,cc), INITIAL=Customer No. :, ATTRB=ASKIP, LENGTH=14 POS=(ll,cc), ATTRB=(UNPROT,NUM,FSET,IC), JUSTIFY=RIGHT, PICIN=9(8), PICOUT=9(8), LENGTH=8 X X X X X X X X

CUSTNO

DFHMDF

7) Attribute character :
Function: a) The attribute character is an invisible 1-byte character, which precedes a screen field and determines the characteristics of a field. b) ASKIP - Autoskip. Data cannot be entered in this field. The cursor skips to the next field. c) PROT - Protected field. Data cannot be entered into this field. If data is entered, it will cause the input-inhibit status. d) UNPROT - Unprotected field. Data can be entered and this is used for all input fields. e) NUM - Numeric field. Only numbers (0 to 9) and special characters (. and -) are allowed. f) BRT - Bright display of a field (highlight). g) NORM - Normal display. h) DRK - Dark display. i) IC - Insert cursor. The cursor will be positioned in this field. Incase, IC is specified more than once, the cursor is placed in the last field. j) FSET - Field set. MDT is set on so that the field data is to be sent from the terminal to the host computer regardless of whether the field is actually modified by the user.

8) Modified Data Tag :


Function: Modified Data Tag (MDT) is a one bit of the attribute character. If it is off (0), it indicates that the terminal operator has not modified the field. If it is on (1), it indicates that the operator has modified this field. Only when MDT is on, the data of the field will be sent by the terminal hardware to the host computer. An effective use of MDT drastically reduces the amount of data traffic in the communication line and thus improves performance. Three ways of setting and resetting the MDT: a) Terminal user modifies a field on the screen, it is automatically set to 1 (on) by the terminal hardware. b) If CNTL=FRSET is specified in the DFHMSD or DFHMDI macro, when the mapset or the map is sent to the terminal,MDT will be reset to 0 (off) i.e. not modified for all the fields of the mapset or the map. c) If FSET is specified in the ATTRB parameter of the DFHMDF macro for a field, when the map is sent to the terminal, MDT will be set to 1. (on i.e. modified) for the field regardless of whether the field has been modified by the terminal user.

You might also like