MAP DEFINITION MACROS - IBM Mainframe

CICS supplies 3 macros for coding BMS maps. They are

  • Mapset definition macro - DFHMSD
  • Map definition macro - DFHMDI
  • Field Definition macro - DFHMDF

Mapset Definition Macro (DFHMSD)

You need one more macro to create a map: DFHMSD, which defines a map set. Maps are assembled in groups called map sets. Typically you group all the maps used by a single transaction or several related transactions. A map set need not contain more than one map, incidentally, and in our simple example, the map set consists of just the "quick check" map.

One DFHMSD macro is placed in front of all the map definitions in the map set. It gives:

  • The name of the map set
  • Whether you are using the maps for output, input, or both
  • Defaults for map characteristics that you did not specify on the DFHMDI macros for the individual maps
  • Defaults for extended attributes that you did not specify in either the field or map definitions
  • Whether you are creating physical or symbolic maps in the current assembly
  • The programming language of programs that use the maps
  • Information about the storage that is used to build the maps

DFHMSD macros vary little from map to map within an installation. Usually the only difference is the mapset name. This macro applies to all maps within a mapset. It occurs only as the first and last macro in a BMS map. Most installations have mapset naming conventions and the name assigned to the mapset must be in the PPT as said before. The DFHMSD macro follows the mapset name as shown in the example:

MSNAME TYPEsMAP,MODE=INOUT,LANG=COBOL,TIOAPEX-YBS

The TYPE operand has three parameters MAP, DSECT and FINAL. A BMS map is assembled twice in order to create two maps: a physical map and a symbolic map. When defined as TYPE=MAP, the physical map is created and when" defined as TYPE=DSECT, the symbolic map is created.

A Proc or standard JCL generally handles the creation of both the maps. Always assemble both the maps at the same time; otherwise the physical and symbolic maps may become out of sync. Every BMS map ends with a DFHMSD TYPE= FINAL macro, followed by an END in the last line.

The other common options are CNTL, MODE, LANG, TIOAPEX, TERM, SUFFIX, STORAGE, etc. The CNTL operand has parameters like FREEKB, FRSET and ALRM. The FREEKB frees the Keyboard and permits the entry of data when a map is sent to the screen. This parameter is usually included.

The FRSET resets the FSET attributes to OFF before the map is sent; for example modified data tags (MDTs), part of attributes, which were on, will be turned off. The ALARM is for sounding audible alarms or beep at the terminal when the map is sent.

The MODE option indicates the input or output operation. The parameter should be IN for the input map and OUT for the output map, i.e. maps involving output only. The INOUT is specified for maps involving both input and output.

The LANG option defines the language of the host program, which will be using the map. If a different host language is to be used, then only this option has to be changed and CICS will generate the appropriate symbolic map. The other languages are ASM, PLI and RPG.

The TIOAPFX=YES will generate a 12-byte filler at the beginning of the symbolic map in order to skip over control characters. Failure to include this operand will cause the map to be misaligned when it is sent.

The TERM option specifies the type of the terminal used. It is required only if the terminal used is not 3270. The SUFFIX option is to specify the user provided suffix number. This must correspond to the TCT parameter. The STORAGE option when specified as AUTO will acquire a separate map area for each mapset.

Map Definition Macro (DFHMDI)

After all the fields on your map are defined, you tell BMS that they form a single map by preceding them with a DFHMDI macro. This macro tells BMS:

  • The name of the map
  • The size, in rows and columns
  • Where it appears on the screen (you can put several maps on one screen)
  • Whether it uses 3270 extended display attributes and, if so, which ones
  • The defaults for these extended attributes for fields where you have not assigned specific values on the DFHMDF macro
  • Device controls associated with sending the map (such as whether to sound the alarm, unlock the keyboard)
  • The type of device the map supports, if you intend to create multiple versions of the map for different types of devices

The map name must be-specified before the DFHMDI macro as shown in the example:

MNAME DFHMDILINE=01, COLUHN-01, SIZE*(24,80)

The LINE and COLUMN indicates the starting position of the map in line and column numbers. The SIZE is used to define the size of the map by the line size and column size, 24x80 in this case. JUSTIFY option can be used to indicate whether the map should be justified LEFT or RIGHT. In addition the DFHMDI macro has the same options as the DFHMSD macro, like CNTL and TIOAPEX. If specified in the DFHMDI, these options will override the corresponding options specified in the DFHMSD macro.

Field Definition Macro (DFHMDF)

You should design the layout of your screen before you attempt to code any macros. After you have done that, you define each field on the screen (page) with a DFHMDF macro. In it, you indicate:

  • The position of the field on the screen
  • The length of the field
  • The default contents (unless you always intend to provide them in the program)
  • Thefielddisplay attributes, governing whether and what the operator can key into the field, whether the cursor stops there, the intensity of the characters, and the initial state of the modified data tag
  • For some terminals,extendeddisplay attributes, such as color, underlining, highlighting
  • The name by which you refer to the field in your program, if you ever modify its contents or attributes

Fields that are referenced by the application must be allocated field names. The length of the field name and the characters that may be used to form field names must conform to the following rules.The characters used must be valid for names of assembler ordinary symbols.This character set consists of the alphabetic characters A - Z (upper or lower case), $, #, @, numeric digits 0 - 9, and the underscore (_) character.

There is one exception to this rule. The hyphen (-) character may be used in field names provided that:

  • The mapset is only used by application programs written in COBOL.
  • The mapset is generated using the High Level Assembler.

The first character of the field name must be alphabetic, but the other characters can be any from the character set described above.

The format of the DFHMDF macro is given below:

format of the DFHMDF macro

The POS option refers to the starting position of the field in terms of line and column numbers, including the attribute character.

ATTRB defines the attribute characteristics of the field. All attributes take up 1 byte immediately preceding the field defined, ASK, UNPROT and PROT attributes define how the cursor will behave and are mutually exclusive. ASKIP causes the cursor to automatically skip over the field and stop at the next unprotected field. The UNPROT causes the cursor to stop at the beginning of the field in order to allow data entry. A stopper or skipper field should follow an UNPROT field; otherwise the entry of data would be permitted to continue till the next ASKIP or PROT field is encountered. In a field whose attribute is defined as PROT data cannot be entered. PROT is commonly used as a stopper field to stop the data entry after an UNPROT field. The difference between ASKIP and PROT is that PROT will stop the data entry, but ASKIP will jump to the next unprotected field and allow the continued entry of data.

The NUM option causes the data entered into a numeric field to be right justified and unfilled positions to the left to be filled with zeros. Field not defined, as NUM will be left justified and the unfilled positions will be filled with spaces.

The NORM, BRT and DRK attributes specify the intensity of the field, NORM for normal intensity, BRT for bright intensity or highlighting and DRK for dark intensity, which is usually used for passwords since the data entered into this field cannot be seen.

When the terminal user enters data into a field, the MDT is turned on which causes the entered data to be received into the program. Specifying the FSET in the BMS will turn on the MDT. This returns the data in the field even if the user has not entered any data into the field. The IC or Insert Cursor attribute will cause the cursor to be positioned in this field. If IC is specified in more than one field of a map, the cursor will be placed in the last field. The LENGTH option indicates the length of the field and the INITIAL option defines the initial value of the field if any. If the number of characters defined in the INITIAL option exceeds the LENGTH option, then the excess characters will be truncated when the map is sent. The PICIN and PICOUT options define the picture clauses of the symbolic maps and defaults to X if none is specified. The OCCURS option generates an occurs clause for the defined number of occurrences. This clause is most commonly used with map fields, which are to be indexed such as in a browse display.

format of the DFHMDF macro

Thus using the above mentioned 3 macros DFHMSD, DFHMDI and DFHMDF the mapsets can be defined. Here the rule to be followed is that, within a mapset there can be any number of map definitions and within a map definition there can be any number of field definitions.

MAP DEFINITION MACROS

MAP DEFINITION MACROS

MAP DEFINITION MACROS


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM Mainframe Topics