BMS-I

Post on 30-Oct-2014

112 views 0 download

Tags:

Transcript of BMS-I

BASIC MAPPING SUPPORT

PART 1

Enter Name:XYZENter Age:23ENTER DEPT:S/WENTER SALARY:34000

LTITL

Name: XXXXXXXXXXXXXXX

Age:

Department:XXXXXXXXXXXXXX

Salary:

F1-Save F2-Exit F3-Previous

BMS are macro commands written in assembly language to define a formatted screen in CICS.

BMS also eliminates the difficulties involved in NMDS.

What’s NMDS?

In order to get a formatted output in an IBM 3278 terminal , it must receive a stream of data called Native Mode Data Stream. NMDS is based on the hardware protocol.

NMDS is a mixture of Buffer Control Characters (BCC) and text data. The application program must format all BCC’s and text data in order to get a formatted screen.

Buffer Control Characters:

Buffer control characters are some control information which characterizes the format of the output screen.

STX

ESC

EW

WCC

SBA

08SF

ATR

SF

ATR

PNC2 ETX

STX Start Text

ESC Escape Command

EW Erase/Write

WCC Write control character

SBA Set Buffer Address

SF Start Field

ATR Attribute Character

ETX End Text

Disadvantages of NMDS.

Consider the following situation:

1. The terminal device has been changed.

2. The screen format has been changed , though the length remains same.

In each of the above said situations the program should be changed.

This reduces the maintainability of the application.

To eliminate the disadvantages of NMDS , and to obtain device independence and format independence CICS introduced BMS.

What’s Device Independence & Format Independence?

Device Independence:

A code written using BMS can run in any terminal type. So the application need not depend on hardware protocol.

Format Independence:

The application program need not be changed if there is any change in the screen layout , provided the field name and length remain same.

MAPS:

A screen defined through BMS is called a map.

Types of MAPS:

1. Physical Map.

2. Symbolic Map.

Physical Map:

The objective of the physical map is to obtain device independence in the application programs.

Physical map defines the maximal length and starting position of each field and allows BMS to interpret input NMDS.

Contd….

Physical Map Generation:

The physical map is coded using BMS macros , assembled separately , and linkedited into the CICS load library.

BMS Macro Assembly Linkedit

Load Module Loadlib CICS

Symbolic Map:

The primary objective of symbolic map is to ensure device and format independence.

A layout change can be made without affecting the application program.

Contd….

Symbolic Map Generation:

Symbolic map are coded using BMS , assembled separately , cataloged into the copy library (COPYLIB) , at the time of compiling , this is copied into the application program.

MAPSET:

A group of maps is called Mapset.

Mapset name must be defined in the PPT. This is because CICS considers BMS mapset as a program coded in assembler.

MAPSET

MAP1 MAP2 MAP3

MAP4 MAP5 MAP6

MAP7 MAP8 MAPn

MAPSET

MAP

MACROS:

BMS provides assembler macros as follows:

1. DFHMSD

2. DFHMDI

3. DFHMDF

DFHMSD:

This macro is used to define mapset.

DFHMDI:

This macro is used to define a map.

DFHMDF:

This macro is used to define a field in the map.

Mapset definition:

MAPSET1 DFHMSD TYPE=&SYSPARM , X

MODE=INOUT, X

LANG=COBOL , X

STORAGE=AUTO , X

TIOAPFX=YES , X

CNTL=(FREEKB,FRSET)

TYPE=

DSECT

MAP

&SYSPARM

For symbolic map.

For physical map.

Assembly Procedure.

FINAL To end a mapset.

MODE=

IN: For input map.

OUT: For output map.

INOUT: For input/output map.

LANG=

COBOL

ASM

PL1

RPG or

any language which supports CICS.

TIOAPFX=YES/NO

Coded ‘YES’ , reserves a prefix space (12bytes) for BMS commands to access TIOA properly.

CNTL=

FREEKB: Frees the keyboard.

FRSET: Resets the MDT tag.

ALARM: Gives a beep whenever the map is invoked.

PRINT: Mapset is sent to the printer.

TERM=<type>

This is coded , if the application runs on a terminal other than 3270.

This ensures device independence.

DFHMDI:

MAP1 DFHMDI SIZE=(24,80), X

LINE=1, X

COLUMN=1 X

JUSTIFY=LEFT

24

80

MAP1

DFHMDF:

DFHMDF POS=(3,10), X

INITIAL=‘SWBT’, X

ATTRB=ASKIP, X

LENGTH=4

Contd….

NAM DFHMDF POS=(6,20), X

ATTRB=(UNPROT,FSET), X

JUSTIFY=RIGHT, X

PICIN=‘9(8)’, X

PICOUT=‘9(8)’, X

LENGTH=8

MAP2 DFHMDI SIZE=(24,80), X

LINE=1, X

COLUMN=1, X

JUSTIFY=RIGHT

This will create another map , map2 within the same mapset.

DFHMSD TYPE=FINAL

This ends the macro definition. No command should follow after this statement.

ATTRIBUTES:

ASKIP PROT

UNPROT NUM

BRT NORM

DRK IC

FSET

ASKIP:

AutoSKIP , data cannot be entered into a field with ASKIP attribute. The cursor skips to the next field.

PROT:

Protected field. Data cannot be entered into a protected field. Difference between ASKIP and PROT is that in ASKIP the cursor moves to the next field , whereas in PROT field the cursor is not skipped. If the user tries to enter any data in protected field , it will cause the input-inhibit status.

UNPROT:

Unprotected field. Here the data can be entered. It must be specified for input fields.

NUM:

Numeric field. Only numeric values (0-9) is allowed and special characters (‘.’ & ‘-’) are also allowed. Any alphabetical input will cause the input-inhibit status.

BRT:

Bright display , similar to highlight in COBOL.

NORM:

Normal display.

IC:

Insert cursor. The cursor will be positioned in the specified field when the map is sent. If IC is specified for all fields the cursor is positioned in the last field.

FSET:

Field Set. This is used to set on the MDT.

LTITL

Name: XXXXXXXXXXXXXXX

Age:

Department:XXXXXXXXXXXXXX

Salary:

F1-Save F2-Exit F3-Previous

Modified Data Tag (MDT):

MDT is a one bit attribute character. It is off (0) when the terminal user has not modified the field.

When the terminal user enters any data in the field the MDT is on (1).

When the MDT is on i.e., 1 , the data is sent from the terminal hardware to the host computer.

As a good programming practice , it’s advised to reset the MDT when ever the map is sent to the terminal.

How the map variables fit into the application program?

The map variables are copied into the application program through the COBOL copy statement.

When the symbolic map is generated , the map variables are created as working-storage variables. For example

02 NAM+x PIC X(8).

where ‘x’ is the suffix. Contd….

L Halfword binary PIC S9(4) COMP

F Flag byte. This is for input field , it will have value X’80’ if field has

been has been modified but no data is sent. By default this field is X’00’.

A Attribute byte for I/O fields.

I For input fields.

O For output fields.

SKIPPER & STOPPER TECHNIQUES.

Skipper technique is used to improve user friendliness.

Stopper technique is used to avoid overflow of data in the terminal.

END OF PART 1