Upload
jayaganesh
View
222
Download
1
Tags:
Embed Size (px)
DESCRIPTION
BMS Basics
Citation preview
04/18/23 Prepared by: Ratnaker M
BMS MACROS
04/18/23 Prepared by: Ratnaker M
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.
04/18/23 Prepared by: Ratnaker M
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 doesn’t change)
04/18/23 Prepared by: Ratnaker M
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
04/18/23 Prepared by: Ratnaker M
BMS SAMPLE SCREEN
TICKET RESERVATION
NAME : RATNAKER M_____ AGE : 023
DOJ : 02 / 01 / 2003 TRN NO. : 9999
COACH NO. : ___ SEAT NO. : __
______________________________________________
04/18/23 Prepared by: Ratnaker M
BMS SAMPLE SCREEN
$TICKET RESERVATION$
$NAME : $RATNAKER M_____$ $AGE : $023$
$DOJ : $02$/$01$/$2003$ $TRN NO. : $9999$
$COACH NO. : $___$ $SEAT NO.: $__$
$PLEASE ENTER THE DETAILS________________$
04/18/23 Prepared by: Ratnaker M
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)
04/18/23 Prepared by: Ratnaker M
BMS MAP DEFINITION MACROS • DFHMSD – Defines a MAPSET
• DFHMDI – Defines a MAP with in a Mapset
• DFHMDF – Defines a FIELD of the Map
04/18/23 Prepared by: Ratnaker M
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
04/18/23 Prepared by: Ratnaker M
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.
04/18/23 Prepared by: Ratnaker M
DFHMSD MACRO
MAPSETN DFHMSD TYPE=(&SYSPARM|DSECT\MAP), X MODE=(INOUT|IN|OUT), X LANG=(COBOL|ASM|C|PLI), X TERM=3270,STORAGE=AUTO, X TIOAPFX=(YES|NO), X CTRL=(Prameters)
DFHMSD TYPE=FINAL ENDDSECT: Generation of Symbolic MapMAP: Generation of Physical Map&SYSPARM: To generate both Physical and Symbolic Map
using symbolic parameter.
04/18/23 Prepared by: Ratnaker M
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.
04/18/23 Prepared by: Ratnaker M
DFHMDF MACRO
* Definition of a Data FieldFLDNAME DFHMDF POS=(Line,Column), X LENGTH=Number, X INITIAL=‘Text’, X
PICIN=‘9999’, X PICOUT=‘ZZZ9’, X
ATTRB=(Attr1,Attr2,Attr3,Attr4,Attr5)
*Definition of a Label DFHMDF POS=(Line,Column), X LENGTH=Number, X ATTRB=ASKIP, X INITIAL=‘TexttxxxxxxxxxxxxxxxxxxtttttttX ttttxxxx’
04/18/23 Prepared by: Ratnaker M
ATTRIBUTES
• ASKIP | PROT | UNPROTASKIP - 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. (Install’n 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 IC’s are mentioned the cursor gets positioned at the last field where IC was mentioned.
• FSET - Sets the MDT of a field to ON
04/18/23 Prepared by: Ratnaker M
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). . . . . . .
04/18/23 Prepared by: Ratnaker M
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 X’80’. In all other cases this will have X’00’. (This is useful as L field in this case will have 0 length)
04/18/23 Prepared by: Ratnaker M
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
04/18/23 Prepared by: Ratnaker M
RECEIVE MAP
Syntax:
EXEC CICS RECEIVE
MAP (MAPNAME)
MAPSET (MAPSET-NAME)
INTO (MAPNAMEI)
LENGTH (LENGTH-OF-MAP)
ASIS
RESP (WS-RESP)
END-EXEC.
04/18/23 Prepared by: Ratnaker M
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.
04/18/23 Prepared by: Ratnaker M
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)
04/18/23 Prepared by: Ratnaker M
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.
04/18/23 Prepared by: Ratnaker M
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 won’t 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.
04/18/23 Prepared by: Ratnaker M
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.
04/18/23 Prepared by: Ratnaker M
An Example - BMS SAMPLE SCREEN
$TICKET RESERVATION$
$NAME : $RATNAKER M_____$ $AGE : $023$
$DOJ : $02$/$01$/$2003$ $TRN NO. : $9999$
$COACH NO. : $___$ $SEAT NO.: $__$
$PLEASE ENTER THE DETAILS________________$
04/18/23 Prepared by: Ratnaker M
An Example - BMS MACRO SAMPLE DFHMSD TYPE=&SYSPARM,MODE=INOUT,LANG=COBOL,STORAGE=AUTO, X
TIOAPFX=YES,CNTL=(FREEKB,PRINT),TERM=3270
RESERVE DFHMDI SIZE=(24,80),LINE=01,COLUMN=01,JUSTIFY=LEFT, X
TIOAPFX=YES,CNTL=(FRSET)
DFHMDF POS=(02,21),LENGTH=18,ATTRB=ASKIP, X
INITIAL=‘TICKET RESERVATION’
DFHMDF POS=(06,02),LENGTH=11,ATTRB=ASKIP, X
INITIAL=‘NAME :’
NAME DFHMDF POS=(06,14),LEMGTH=15,ATTRB=(UNPROT,FSET,IC)
DFHMDF POS=(06,30),LENGTH=01,ATTRB=ASKIP
DFHMDF POS=(06,39),LENGTH=10,ATTRB=ASKIP, X
INITIAL=‘AGE :’
AGE DFHMDF POS=(06,50),LEMGTH=03,ATTRB=(UNPROT,FSET,NUM), X
PICIN=‘999’,PICOUT=‘999’
DFHMDF POS=(06,54),LENGTH=01,ATTRB=ASKIP
DFHMDF POS=(10,02),LENGTH=11,ATTRB=ASKIP, X
INITIAL=‘DOJ :’
04/18/23 Prepared by: Ratnaker M
An Example - BMS MACRO contd…
DOJDD DFHMDF POS=(10,14),LENGTH=02,ATTRB=(UNPROT,FSET,NUM), X
PICIN=’99’,PICOUT=’99’
DFHMDF POS=(10,17),LEMGTH=01,ATTRB=ASKIP,INITIAL=‘/’
DOJMM DFHMDF POS=(10,19),LENGTH=02,ATTRB=(UNPROT,FSET,NUM), X
PICIN=’99’,PICOUT=’99’
DFHMDF POS=(10,22),LEMGTH=01,ATTRB=ASKIP,INITIAL=‘/’
DOJCCYY DFHMDF POS=(10,24),LENGTH=04,ATTRB=(UNPROT,FSET,NUM), X
PICIN=’9999’,PICOUT=’9999’
DFHMDF POS=(10,29),LEMGTH=01,ATTRB=ASKIP
DFHMDF POS=(10,39),LENGTH=10,ATTRB=ASKIP, X
INITIAL=‘TRN NO. :’
TRNNUM DFHMDF POS=(10,50),LENGTH=04,ATTRB=(UNPROT,FSET,NUM) X
PICIN=‘9999’,PICOUT=‘9999’
DFHHDF POS=(10,55),LEMGTH=01,ATTRB=PROT
DFHMDF POS=(14,02),LENGTH=11,ATTRB=ASKIP, X
INITIAL=‘COACH NO. :’
04/18/23 Prepared by: Ratnaker M
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, X
INITIAL=‘SEAT NO. :’
SEATNUM DFHMDF POS=(14,50),LENGTH=02,ATTRB=(ASKIP,NUM,BRT), X
PICOUT=’99’
DFHMDF POS=(14,53),LENGTH=01,ATTRB=ASKIP
OUTMSG DFHMDF POS=(20,01),LENGTH=79,ATTRB=ASKIP
DFHMSD TYPE=FINAL
END