Вы находитесь на странице: 1из 27

BMS

MACROS

09/08/15

COMMUNICATION BETWEEN
PROGRAM & TERMINAL USER
Unformatted Manner:
EXEC CICS SEND TEXT
FROM (WS-OUTPUT-TEXT)
LENGTH (Length of WS-OUTPUT-TEXT)
ERASE
END-EXEC.
EXEC CICS RECEIVE
INTO (WS-INPUT-TEXT)
LENGTH (Length of WS-INPUT-TEXT)
END-EXEC.
09/08/15

WHY BMS MACROS?


PROVIDE A MEANS FOR FORMATTED
COMMUNICATION BETWEEN THE TERMINAL
AND THE APPLICATION PROGRAM.
ADVANTAGES:
1. DEVICE INDEPENDENCE
2. FORMAT INDEPENDENCE (As long as the name of
the field and length of the field doesnt change)

09/08/15

STEPS TO USE MAPS IN CICS PGMS


DESIGN SCREEN LAYOUT
WRITE THE CODE FOR THE LAYOUT IN
ASEMBLER MACRO
COMPILE BMS MAP TO GET PHYSICAL MAP &
SYMBOLIC MAP
COPY THE SYMBOLIC MAP(S) IN THE
APPLICATION PROGRAM(S) YOU WANT TO
USE THE MAP(S).
USE CICS MAP HANDLING COMMANDS IN THE
APPLICATION PROGRAM TO DISPLAY AND
RECEIVE DATA FROM THE MAP

09/08/15

BMS SAMPLE SCREEN


TICKET RESERVATION
NAME

: RATNAKER M_____

DOJ

: 02 / 01 / 2003

COACH NO. : ___

AGE : 023

TRN NO. : 9999


SEAT NO. : __

______________________________________________

09/08/15

BMS SAMPLE SCREEN


$TICKET RESERVATION$
$NAME

: $RATNAKER M_____$ $AGE : $023$

$DOJ

: $02$/$01$/$2003$

$COACH NO. : $___$

$TRN NO. : $9999$


$SEAT NO.: $__$

$PLEASE ENTER THE DETAILS________________$

09/08/15

ACQUAINTANCE WITH THE TERMS


MAP
One Screen format. Symbolic map (created with the
name of the mapset) contains the the MAPNAME(I/O) as 01 levels.
One or more maps can be defined in one Mapset.
MAPSET
One or more maps linkedited togeher. CICS considers
the mapset as a program and the load module is created with the name
of MAPSET.
LABEL
Constant data on the screen/map
DATA FIELD Fields used to pass data between terminal TO &
FROM application program
ATTRIBUTE To define the properties of the fields. This is the first
byte of any field defined on the MAP (Label/Data field). This is not
included while specifying the length but is considered as a part of the
field while specifying its starting position.
MDT
Modification Data Tag. The data gets transferred
from the Terminal/Map to the application program only if MDT is ON
(Value of 1)

09/08/15

BMS MAP DEFINITION MACROS


DFHMSD Defines a MAPSET
DFHMDI Defines a MAP with in a Mapset
DFHMDF Defines a FIELD of the Map

09/08/15

BMS MACRO DEFINITON LAYOUT


DFHMSD ----- Start of BMS Macro (MAPSET) definition
DFHMDI Start of definition of MAP-1
DFHMDF Defines a FIELD1 of the Map-1
DFHMDF Defines a FIELD2 of the Map-1

DFHMDI Start of definition of MAP-2


DFHMDF Defines a FIELD1 of the Map-2
DFHMDF Defines a FIELD2 of the Map-2

DFHMSD ---- End of BMS Macro (MAPSET) Definition

09/08/15

BMS MARO DEFINITION RULES


123456789012345678901234567890..72
NNNNNNN DFHMSD PARAMETERS-1 seperated by commas C
PARAMETERS-2
COLUMNS 1-7: NAME OF THE MAPSET / MAP / FIELD
COLUMNS 9-14 : MACRO (DFHMSD / DFHMDI / DFHMDF)
COLUMNS 16-71: PARAMETERS/CHARACTERISTICS OF MAPSET/
MAP/ FIELD
COLUMN 72:
IF THE PARAMETERS/CHARACTERISTICS LIST IS
TO BE CONTINUED TO NEXT LINE; TO CONTINUE A LABEL.

09/08/15

DFHMSD MACRO
MAPSETN DFHMSD TYPE=(&SYSPARM|DSECT\MAP),
MODE=(INOUT|IN|OUT),
LANG=(COBOL|ASM|C|PLI),
TERM=3270,STORAGE=AUTO,
TIOAPFX=(YES|NO),
CTRL=(Prameters)

X
X
X
X
X

DFHMSD TYPE=FINAL
END
DSECT:
Generation of Symbolic Map
MAP:
Generation of Physical Map
&SYSPARM:
To generate both Physical and Symbolic Map using
symbolic parameter.

09/08/15

DFHMDI MACRO
MAPNAME DFHMDI SIZE=(Lines,Columns),
X
LINE=Line-Number|NEXT|FIRST|LAST, X
COLUMN=Col-Nbr,
X
JUSTIFY=(LEFT|RIGHT),
X
TIOAPFX=(YES|NO),
X
CTRL=(FREEKB,FRSET,ALARM,PRINT)

DFHMDI PARAMETRS OVERRIDE DFHMSD PARAMETRS


For COBOL Programs TIOAPFX should be YES for data to flow from
the Map to Application Program. This adds a 12 byte filler at the start
of symbolic map which enables the communication to happen.

09/08/15

DFHMDF MACRO
* Definition of a Data Field
FLDNAME DFHMDF POS=(Line,Column),
LENGTH=Number,
INITIAL=Text,
PICIN=9999,
X
PICOUT=ZZZ9,
X
ATTRB=(Attr1,Attr2,Attr3,Attr4,Attr5)

X
X
X

*Definition of a Label
DFHMDF POS=(Line,Column),
X
LENGTH=Number,
X
ATTRB=ASKIP,
X
INITIAL=TexttxxxxxxxxxxxxxxxxxxtttttttX
ttttxxxx

09/08/15

ATTRIBUTES
ASKIP | PROT | UNPROT
ASKIP - Cursor automatically skips to the next field on the MAP.
PROT
- Cursor stops at the field but data entry not possible
UNPROT - Cursor stops at the field and the field is editable.
NUM
- Specifies that only valid data is Numeric, ., +, -. Trying
to enter any other values locks the keyboard. (Installn dependent)
BRT | NORM | DRK
BRT
Highlights the data in the field
NORM Displays the data in the field normally
DRK
Does not show the data entered in the field (Generally
used for Password fields)
IC
- Specifies the position where cursor should be positioned
when the Map is thrown. If multiple ICs are mentioned the cursor
gets positioned at the last field where IC was mentioned.
FSET
- Sets the MDT of a field to ON

09/08/15

SYMBOLIC MAP FORMAT


01 MAPNAMEI.
02 FILLER
PIC X(12).
02 FIELD1L
PIC S9(04) COMP.
02 FIELD1F
PIC X.
02 FILLER REDEFINES FIELD1F.
03 FIELD1A
PIC X.
02 FIELDI
PIC X(20).
02 FIELD2L
PIC S9(04) COMP. . . . . . .
01 MAPNAMEO REDEFINES MAPNAMEI.
02 FILLER
PIC X(12).
02 FILLER
PIC X(03).
02 FIELD1O
PIC X(20).
02 FILLER
PIC X(03).
02 FIELD2O
PIC X(10). . . . . . .

09/08/15

SYMBOLIC MAP FIELDS


I Field: Fields in which the input is received in Application Program
from the Map(MODE = IN)
O Field: Fields using which the output is sent to Map (MODE = OUT)
Note: If MODE=INOUT, both I & O fields get generated and each is
the redefinition of other. So they can be used interchangeably.
A Field: Attribute field. By moving the predefined values present in
DFHBMSCA copybook, the attributes of the map field can be
manipulated from the application program
L Field: Length field. This field holds the length of data received in a
field after receiving a MAP. During the SEND Map this will tell
where to position the cursor. Moving 1 to this field makes the
cursor position position at that field.
F Field: When a field is modified but no data is sent (field is cleared)
this will hold a value of X80. In all other cases this will have
X00. (This is useful as L field in this case will have 0 length)

09/08/15

TOPICS OF CONCERN

RECEIVE MAP / SEND MAP COMMANDS


CURSOR POSITIONING
MDT MANIPULATION TECHNIQUES
ATTRIBUTE MANIPULATION
MAP ONLY / DATA ONLY
SEND TEXT
ERASE
ERASEUP
ASIS
ACCUM
SEND PAGE

09/08/15

RECEIVE MAP
Syntax:
EXEC CICS RECEIVE
MAP
MAPSET
INTO
LENGTH
ASIS
RESP
END-EXEC.

09/08/15

(MAPNAME)
(MAPSET-NAME)
(MAPNAMEI)
(LENGTH-OF-MAP)
(WS-RESP)

SEND MAP
Syntax:
EXEC CICS SEND
MAP
(MAPNAME)
MAPSET
(MAPSET-NAME)
FROM
(MAPNAMEO)
LENGTH
(LENGTH-OF-MAP)
CURSOR
(Data-Value)
ERASE|ERASEUP
MAPONLY|DATAONLY
ACCUM
RESP
(WS-RESP)
END-EXEC.

09/08/15

CURSOR POSITIONING TECHNIQUES

Static Cursor Positioning: By mentioning IC with the Attributes of a


field (if IC is mentioned for more than one fields, the cursor gets
positioned on the last field for which IC is mentioned)

Dynamic Cursor Positioning: From the application program, by moving


1 to L field of the map field on which to position the cursor.
MOVE 1
TO
FIELDNML.
For this CURSOR option should be mentioned with SEND MAP.
Note: If 1 is moved to more than one fields, then the cursor will get
positioned at the very first field which the map encounters while
searching in a Left to Right and Top to Bottom fashion.

Dynamic Cursor Positioning: By giving a absolute value (w.r.t the start


of the map) with the CURSOR option in SEND MAP command.
Note: IC is overridden by moving 1 to L field and mentioning CURSOR
option which in-turn is overridden by using the absolute cursor
positioning (CUSROSR option with an absolute value)

09/08/15

MDT & ITS MANIPULATION TECHNIQUES

MDT is one of the 8-bits of the attribute character, the value of which
decides whether or not the data from the Map will flow to the application
program on a RECEIVE MAP command.

The data will flow if the MDT of a field is ON (Value = 1).

Ways of Manipulation:
- FRSET: This is one of the Control parameters that can be coded on
DFHMSD or DFHMDI macro. When coded, the MDT of all the fields
defined under the MAPSET/MAP are set to zero/OFF.
- FSET: This is one of the attribute parameters that can be coded with
DFHMDF macro. When coded, the MDT of that particular field is set to
one/ON.
- Application program: The MDT of a field can be set ON or OFF by
moving the predefined field values defined in DFHBMSCA to the A field
of the field in question.
Note: If FSET is mentioned, it overrides the FRSET (if mentioned). The
application program overrides the FRSET, FSET defined in the BMS
Macro.

09/08/15

MAPONLY & DATAONLY

MAPONLY:
If this option is mentioned along with the
SEND MAP, then only the Symbolic map (the values of the data
fields) will be send to the terminal. This is generally used for all
subsequent SEND MAP commands after the initial SEND MAP
command. The values present in the symbolic map will get
populated on the screen at their appropriate field locations
automatically.
DATAONLY:
If this option is specified, only the physical
map is sent to the terminal. Physical Map is the formatted map
only with the labels. The data fields wont be populated with any
values until there are already some values present in their
location on the screen.
No Option Specified: Both the physical map and the symbolic
map are merged and sent to the terminal.

09/08/15

ERASE, ERASEUP & ASIS


When a MAP is sent to the terminal, the MAP gets overlaid on the
screen/any data present on the screen.

ERASE:
When specified, before the Map is thrown on the
terminal, all the data present on the terminal is erased and then
the Map is sent to/thrown on the terminal.

ERASEUP: When specified, before the Map is thrown on the


terminal, all the unprotected data present on the terminal is erased
and then the Map is sent to/thrown on the terminal. For example
a MAP is already present on the screen, the data of all the
unprotected fields of the existing Map are erased and the new
Map is then overlaid on the existing map.

ASIS: When specified with RECEIVE MAP, the data is received


as entered on the map, i.e, the data becomes case sensitive.
Otherwise, by default the data is converted to UPPER CASE
when received in the program.

09/08/15

An Example - BMS SAMPLE SCREEN


$TICKET RESERVATION$
$NAME

: $RATNAKER M_____$ $AGE : $023$

$DOJ

: $02$/$01$/$2003$

$COACH NO. : $___$

$TRN NO. : $9999$


$SEAT NO.: $__$

$PLEASE ENTER THE DETAILS________________$

09/08/15

An Example - BMS MACRO


SAMPLE

DFHMSD TYPE=&SYSPARM,MODE=INOUT,LANG=COBOL,STORAGE=AUTO,

RESERVE DFHMDI
DFHMDF
DFHMDF
NAME

AGE

DFHMDF
DFHMDF
DFHMDF
DFHMDF
DFHMDF
DFHMDF

TIOAPFX=YES,CNTL=(FREEKB,PRINT),TERM=3270
SIZE=(24,80),LINE=01,COLUMN=01,JUSTIFY=LEFT,
TIOAPFX=YES,CNTL=(FRSET)
POS=(02,21),LENGTH=18,ATTRB=ASKIP,
INITIAL=TICKET RESERVATION
POS=(06,02),LENGTH=11,ATTRB=ASKIP,
INITIAL=NAME
:
POS=(06,14),LEMGTH=15,ATTRB=(UNPROT,FSET,IC)
POS=(06,30),LENGTH=01,ATTRB=ASKIP
POS=(06,39),LENGTH=10,ATTRB=ASKIP,
INITIAL=AGE
:
POS=(06,50),LEMGTH=03,ATTRB=(UNPROT,FSET,NUM),
PICIN=999,PICOUT=999
POS=(06,54),LENGTH=01,ATTRB=ASKIP
POS=(10,02),LENGTH=11,ATTRB=ASKIP,
INITIAL=DOJ
:

09/08/15

X
X
X

X
X

An Example - BMS MACRO


DOJDD

contd

DFHMDF POS=(10,14),LENGTH=02,ATTRB=(UNPROT,FSET,NUM),
PICIN=99,PICOUT=99
DFHMDF POS=(10,17),LEMGTH=01,ATTRB=ASKIP,INITIAL=/
DOJMM
DFHMDF POS=(10,19),LENGTH=02,ATTRB=(UNPROT,FSET,NUM),
PICIN=99,PICOUT=99
DFHMDF POS=(10,22),LEMGTH=01,ATTRB=ASKIP,INITIAL=/
DOJCCYY DFHMDF POS=(10,24),LENGTH=04,ATTRB=(UNPROT,FSET,NUM),
PICIN=9999,PICOUT=9999
DFHMDF POS=(10,29),LEMGTH=01,ATTRB=ASKIP
DFHMDF POS=(10,39),LENGTH=10,ATTRB=ASKIP,
INITIAL=TRN NO. :
TRNNUM DFHMDF POS=(10,50),LENGTH=04,ATTRB=(UNPROT,FSET,NUM)
PICIN=9999,PICOUT=9999
DFHHDF POS=(10,55),LEMGTH=01,ATTRB=PROT
DFHMDF POS=(14,02),LENGTH=11,ATTRB=ASKIP,
INITIAL=COACH NO. :

09/08/15

X
X

An Example - BMS MACRO

contd

COACH

DFHMDF POS=(14,14),LENGTH=03,ATTRB=(ASKIP,BRT)
DFHMDF POS=(14,18),LENGTH=01.ATTRB=ASKIP
DFHMDF POS=(14,39),LENGTH=10,ATTRB=ASKIP,
INITIAL=SEAT NO. :
SEATNUM DFHMDF POS=(14,50),LENGTH=02,ATTRB=(ASKIP,NUM,BRT),
PICOUT=99
DFHMDF POS=(14,53),LENGTH=01,ATTRB=ASKIP
OUTMSG DFHMDF POS=(20,01),LENGTH=79,ATTRB=ASKIP
DFHMSD TYPE=FINAL
END

09/08/15

X
X

Вам также может понравиться