You are on page 1of 32

Basic Mapping Support

Day2
Objectives
• Introduction to BMS
– Screen Layout
– Physical map and Symbolic map
– Map and Mapset
• Creating a simple map
– Map definition macros
– Modified data tag and other attributes
– Handling program attention keys
• Programming to use maps
– SEND MAP command
– RECEIVE MAP command
– Data validation
– Changing the attributes dynamically

Copyright © 2005, Infosys 2 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
BMS – Basic Mapping Support

• An interface between CICS programs and the


terminal devices
• In BMS, the design and format of the application
can be separate from the logic
• BMS finds the device information from the
terminal rather than the application program

Copyright © 2005, Infosys 3 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
Formatted Screens
• Screens with fields in proper positions with
proper attributes.
• Require Buffer Control Characters (BCCs) to be
sent along with data.
• The mixture of BCCs and TEXT is called as
Native Mode Data Stream (NMDS) which
depends on the protocol of the terminal being
used.

Copyright © 2005, Infosys 4 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
Formatted Screen - an Example

SCR1 MAIN MENU DATE: 04/03/98


TIME : 12:14:16

1. EMPLOYEE RECORD MAINTENANCE

2. EMPLOYEE DETAILS BROWSE

3. EXIT

SELECTION : - (1/2/3)

Your Choice Please


F1 - Help F3 - Exit ENTER - Process

Copyright © 2005, Infosys 5 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
Physical Maps
• Physical map contains the display format for the
map, for a given terminal, available as a load
library member.
– Length and location
– Attributes
– Constants
– Device characteristics

BMS macro coding Assembly Linkedit

Load module LOADLIB To be used by CICS

Copyright © 2005, Infosys 6 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
Symbolic Maps
• Symbolic map contains all variable data which is
copied into programs working storage section,
available as copy library member.

BMS macro coding Assembly Symbolic map generation

COPYLIB Copied (COPY) into CICS appl. program

Copyright © 2005, Infosys 7 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
MAP & MAPSET
• MAP
– is a single screen format
• MAPSET
– is a collection of maps link-edited together to create a load module.
– should have a PPT entry.
• Naming
– 1 to 7 chars of generic name for maps and mapsets
– 1 char added by CICS.

Copyright © 2005, Infosys 8 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
BMS Assembly Language Program

• BMS map is a program written in Assembly


Language to manage screens.
• The BMS Macros are
– DFHMSD (Mapset definition)
– DFHMDI (Map definition)
– DFHMDF (Map Field definition)

Copyright © 2005, Infosys 9 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
DFHMSD Parameters
• TYPE=DSECT/MAP/&&SYSPARM/FINAL
• MODE=IN/OUT/INOUT
• LANG=ASM/COBOL/PL1
• STORAGE=AUTO/BASE=name
• CTRL=(PRINT,FREEKB,ALARM,FRSET)
• TERM=terminal type,SUFFIX=n
• TIOAPFX=YES/NO
• MAPATTS=(COLOR,HIGHLIGHT,.......)
• DSATTS=(COLOR,HIGHLIGHT,.......)
– COLOR=DEFAULT/colour
– HIGHLIGHT=OFF/BLINK/REVERSE/UNDERLINE

Copyright © 2005, Infosys 10 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
Example of DFHMSD
DFHMSD TYPE=&&SYSPARM, X
CTRL=(FREEKB,FRSET), X
LANG=COBOL, X
STORAGE=AUTO, X
TIOAPFX=YES, X
MODE=INOUT, X
TERM=3270
DFHMSD TYPE=FINAL
END

Copyright © 2005, Infosys 11 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
DFHMDI Parameters
• SIZE=(LINE,COLUMN)
• LINE=line-number
• COLUMN=column-number
• JUSTIFY=left/right
• CTRL=(PRINT,FREEKB,ALARM,FRSET)
• TIOAPFX=YES/NO
• MAPATTS=(COLOR,HIGHLIGHT,.......)
• DSATTS=(COLOR,HIGHLIGHT,.......)
– COLOR=DEFAULT/colour
– HIGHLIGHT=OFF/BLINK/REVERSE/UNDERLINE

Copyright © 2005, Infosys 12 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
Example of DFHMDI

MAPNAME DFHMDI SIZE=(24,80), X


LINE=01, X
COLUMN=01, X

CTRL=(FREEKB,FRSET)

Copyright © 2005, Infosys 13 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
DFHMDF Parameters
• POS=(line,column)
• LENGTH=number
• INITIAL=‘text’
• JUSTIFY=(LEFT/RIGHT,BLANK/ZERO)
• ATTRB=(ASKIP/PROT/UNPROT, NUM, BRT/NORM/
DRK, IC, FSET)
• COLOR=DEFAULT/colour
• HIGHLIGHT=OFF/BLINK/REVERSE/UNDERLINE
• PICIN=‘value’
• PICOUT=‘value’
• OCCURS=n

Copyright © 2005, Infosys 14 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
Example of DFHMDF

DFHMDF POS=(01,01), LENGTH=4, X


INITIAL=‘SCR1’, X
ATTRB=(PROT,NORM)

DATEM DFHMDF POS=(01,70), LENGTH=08, X


ATTRB=(PROT,NORM)
DFHMDF POS=(01,79), LENGTH=1, X
ATTRB=ASKIP

Copyright © 2005, Infosys 15 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
MDT - Modified Data Tag

• It is used to know whether the field is modified


by the user or not.The field is only receivable if
it has been modified.

Copyright © 2005, Infosys 16 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
FORMAT OF SYMBOLIC MAP
• A 12-byte TIOA (Terminal Input/Output Area) prefix.

• The mapnames are suffixed with ‘I’ and ‘O’

• When performing INPUT functions fields suffixed with


‘L’, ’F’ and ‘I’ are meaningful

• When performing OUTPUT functions fields suffixed


with ‘A’, and ‘O’ are meaningful

Copyright © 2005, Infosys 17 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
Using OCCURS clause

• It is a tedious task to define different field names


in a listing which are same and access them.
• To overcome this you use the OCCURS clause
in the field and you can address the field by
using the subscript.

Copyright © 2005, Infosys 18 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
SEND MAP
EXEC CICS SEND
MAP(‘map name’)
[MAPSET(‘mapset name’)]
[FROM(data-area)]
[LENGTH(data_value)]
[DATAONLY]
[MAPONLY]
[CURSOR]
[ERASE/ERASEAUP]
[FREEKB]
[FRSET]
END-EXEC

Copyright © 2005, Infosys 19 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
SEND MAP

Ex. EXEC CICS SEND


MAP(‘EMPMAP’)
MAPSET(‘EMPLIST’)
ERASE
FREEKB
END-EXEC

Copyright © 2005, Infosys 20 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
RECEIVE MAP

EXEC CICS RECEIVE


MAP(‘map name’)
[MAPSET(‘mapset name’)]
[INTO(data-area)]
[FROM(data-area)]
[LENGTH(data_value)]
END-EXEC

Copyright © 2005, Infosys 21 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
RECEIVE MAP

Ex. EXEC CICS RECEIVE


MAP(‘EMPMAP’)
MAPSET(‘EMPLIST’)]
END-EXEC

Copyright © 2005, Infosys 22 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
Validate Fields
• Fields can be evaluated using the L, F or the I
sub-fields
• The key pressed by the user is evaluated by
using EIBAID
• CICS provides you with a pre-coded set which
holds the symbolic values of attention identifier
– COPY DFHAID (DFHENTER, DFHCLEAR, DFHPF1 etc)

Copyright © 2005, Infosys 23 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
Dynamic Cursor positioning.

• Move -1 to the symbolic map variable suffixed


with L.
• Send the map with a CURSOR option in SEND
MAP.

Copyright © 2005, Infosys 24 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
Dynamically changing attributes.
• COPY DFHATTR in your program.
• Choose the attribute from the list you want to
use and move it to the symbolic field variable
suffixed with ‘A’.
• You can also do it by copying DFHBMSCA
having different options.

Copyright © 2005, Infosys 25 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
DFHBMUNN Numeric Normal Off

DFHBMSCA
DFHBMPRO Protected attribute
Normal values
Off

DFHBMASK Autoskip Normal Off

DFHBMBRY Unprotected Bright Off

DFHPROTI Protected Bright Off

DFHBMASB Autoskip Bright Off

DFHBMDAR Unprotected Non-display Off

DFHPROTN Protected Non-display Off

DFHBMFSE Unprotected Normal On

DFHUNNUM Numeric Normal On

DFHBMPRF Protected Normal On

DFHBMASF Autoskip Normal On


Copyright © 2005, Infosys 26 ER/CORP/CRS/TP01/003
DFHUNIMD Unprotected Bright
Technologies Ltd On No: 1.0
Version
Sample mapset Development
Step 1: Open a tso session.
Step 2: Create a new PDS.
Step 3: Code the following mapset in a new member.

Copyright © 2005, Infosys 27 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
Sample mapset Development
Step 4: Assemble the mapset using the clist
TRNGBMS.

Step 5: Open a CICS Session.

Step 6: Install the program using the command

CEMT SET PROG(mapset-name) NEW

Copyright © 2005, Infosys 28 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
Execution of the sample mapset
Step1: Open Client session for Mainframe, type
CICS3 and hit ENTER key. Enter your User id and
Password and press the Enter Key.

Copyright © 2005, Infosys 29 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
Execution of the sample mapset
Step 2: Type the command

CECI SEND MAP(map-name) MAPSET(mapset-name) ERASE FREEKB

Copyright © 2005, Infosys 30 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
Summary
• What is a BMS?
• What are the two kinds of maps? Why do we need
them?
• What are the macros used to define?
• What is MDT, FSET and FRSET?
• What are the symbolic map fields generated?
• How to detect the key pressed?
• How to dynamically change the attributes of the
fields?
• Sample Mapset development
Copyright © 2005, Infosys 31 ER/CORP/CRS/TP01/003
Technologies Ltd Version No: 1.0
Thank You!

Copyright © 2005, Infosys 32 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0

You might also like