Mainframes 360
The one stop destination for System Z professionals

Sunday, May 8, 2011

Creating and Assembling CICS Maps

Q. What are the essential elements of a CICS Map?
Organic Chemistry involves the study of complex Carbon-compounds, that are made up of simple elements like Carbon, Hydrogen, Nitrogen, Oxygen and combine to form bonds. CICS Maps are like Organic compounds, they consist of several elements, which form bonds and result in a nice, user-friendly interface. Every CICS Map consists of elementary Field(s). A field is any data-item on the CICS Map. Fields meant for Input, where the user can type some data, are called Data-Entry Fields. Fields that are used to display Titles, Labels or Captions, Alert Messages are Display-Only Fields.
Q. What are Attribute Bytes?
Every Field on the CICS Screen has Characteristics or Attributes. Attributes control the look-and-feel as well as the behavior of the field. This attribute information is stored in one Extra Byte. As you may see in the below diagram, each field is preceded by an Attribute-Byte. In fact, a field doesn't end, unless the next Attribute-Byte comes in. Take a look at the picture below.


One field ends, when next field's Attribute Bytes comes in. What happens in the case of the Data-Entry Field? Had the Data-Entry Field been followed successively by another field, it's attribute byte would have ended the Data-Entry field. But, there’s no field that succeeds the Data-Entry Field on the same line. So, the Data-Entry field would extend all the way upto the next line, where the Attribute-Byte of the Caption Field 'Name and Address . . . :' is encountered. To avoid this, you would have explicitly code a Closing Attribute Byte after the Data-Entry Field.
Q. How to code the Attribute Byte?
There are three important parameters you can control, using the Attribute Byte – Intensity, Protection and Shift.


The Intensity relates to the appearance of a field. NORM stands for Normal Intensity, BRT for Bright Intensity. DRK Dark helps to hide characters, by darkening them, like when you type Passwords.

The Protection allows/dis-allows the user-entry of data into a Field. PROT stands for protected, and implies that this field is a Display-Only Field. UNPROT stands for Un-protected and implies that this field allows data-entry. A Skip-Field defined by ASKIP is a special type of a protected field, where automatically skips the cursor to the next un-protected field.

The Shift Attribute determines whether the keyboard is in Alphanumeric Shift or Numeric Shift. If you code NUM, it turns the Numeric Lock ON, so the user can only enter Numeric Digits 0-9.

The Attribute-Byte contains 8-Bits of Data. The first seven bits store the Intensity, Protection and Shift Information. The Last bit of the Attribute-Byte is called Modified Data Tag(MDT). If the MDT contains Bit 0, it means data in this field has not changed. If the MDT Bit contains 1, it means data was modified.
Q. What are the important BMS Macros that you code to create a new Map?
The important BMS Macros that you must learn to code, to design and create a complete map are -

Q. How to code the DFHMSD Macro, to define a new Mapset?
A Mapset is a collection of Maps. To define a New Mapset, you must code the DFHMSD Macro. The Syntax of the DFHMSD Macro is shown below -


First of all, you should assign a unique-name to your Mapset. I have chosen the name 'INQSET1' for my Mapset, which contains the Customer Inquiry Map.

The TYPE Parameter what happens when this BMS Map Source Code, is Assembled. A TYPE=&SYSPARM means both a Physical Map and Symbolic Map will be generated. TYPE=DSECT generates only a Symbolic Map. TYPE=MAP generates only a Physical Map.

The LANG Parameter indicates the Language, in which the Symbolic Map Variables are generated. Since, later you are gonna write a Program in COBOL, to process the User Inputs from this Map, I have coded LANG=COBOL.

The MODE Parameter is usually coded as INOUT, so that the Symbolic Map will include both Input(I) and Output(O) COBOL Variables.

The TERM Parameter is the type of terminal. For the Customer Inquiry Screen, I have coded TERM=ALL.

The CTRL Parameter is used to specify the Control Options used by all the Maps in the Mapset. You may also specify the Control Options separately for each Map(Screen) in the Mapset, by coding the CTRL Parameter on each DFHMDI Macro. Control Options used frequently are FREEKB. When a Map is displayed on the Screen, by default the Keyboard is in a Locked State, and you'd have to press RESET Key, to type any inputs. To avoid this Keyboard Lock, you'd code a CTRL=FREEKB. ALARM is another Control Option. It causes an Beep Sound to be played when the Map is displayed on the screen.

The DSATTS(Symbolic Map) and MAPATTS(Physical Map) parameters are used to specify which Extended Attributes will be supported. Extended Attributes include Color of the Field, whether its highlighted or not.

The TIOAPFX Parameter causes a 12-bytes Filler Item to be included at the beginning of the Symbolic Map. As a thumb-rule, you must always specify TIOAPFX=YES for COBOL Maps.

Q. How to code the DFHMDI Macro, to define a New Map?
To define a new Map within a Mapset, you must code the DFHMDI Macro. The general syntax of the DFHMDI Macro is shown below -


First, assign a unique name to you map. I have assigned the Name 'INQMAP1' to the Customer Inquiry Map.

The SIZE specifies the size of the Map, in terms of number of rows and Columns. The standard size of most maps are 24 Rows x 80 Columns.

The LINE parameter specifies the Row-Number where the Map actually starts. I have coded LINE=01 for my map.

The COLUMN parameter specifies the Column-Number where the Map starts. I have coded COLUMN=01 for my map.

Q. How to code the DFHMDF Macro, to define a new field on the Map?
The DFHMDF Macro is used to define the a new field on the Map. You must code one DFHMDF Macro for each field on the Map. What really happens is, when you code a DFHMDF Macro, it creates and Attribute Byte. As I've said before, for the Data-Entry Field, you'll have to explicitly code a closing attribute-byte, so for the Data-Entry field, I am going to code two DFHMDF Macros.

The general syntax of the DFHMDF Macro is shown below -


First, code a label or Field-Name, if you'd like to process this field in the COBOL Program. For example, whatever the user enters in the '______' field, needs to be processed by the COBOL Program, so I have named this field CUSTNO.

The POS Parameter
specifies the co-ordinates in terms of row-no. and col-no. of the Field. For example, if you want to define the field
'Customer Number. . . . .' on the Row No. 5 and Column 1, you should code

The LENGTH Parameter specifies the length of the Data in Field. For example for the field 'CUSTINQ1', the data contains 8 characters, so I should code LENGTH=08. This will actually occupy
9 Screen Positions = 8 Data Characters + 1 Attribute Byte.

The next ATTRB Parameter is used to specify the Attributes of the Field. Some other options in the ATTRB Parameter include IC(Initial Cursor). IC Option in the ATTRB Parameter, indicates that the cursor should be placed at the start of this field, when the map is displayed on the screen. The FSET Option of the ATTRB Parameter causes the MDT to be turned on.

The COLOR Parameter lets you specify a Color for your field.

The PICIN and PICOUT Parameters lets you specify PICTURE Clauses for the Input and Output Cobol variables in the Symbolic Map.

Here is the complete BMS Macro Source Code for the Customer Inquiry Screen, with all the DFHMSD, DFHMDI and DFHMDF Macros.

Q. How to assemble CICS Maps? What are Physical and Symbolic Maps?
The CICS Map Source Code containing the BMS Macros must be Assembled and Link-Edited into a Load Module. A CICS Map is also a Program. To run Programs, you must compile the Source Program into a Load Module. Like-wise, to run a CICS Map and see what it looks like on the Terminal Screen, you must Assemble the Map Source Code into a Load Module. This Load Module is called Physical Map.

On the other hand, a Symbolic Map or DSECT is obtained when you assemble the CICS Map Source Code with DSECT Option. A Symbolic Map contains a List of COBOL Variables corresponding to the different fields on the screen.

I have written a Assemble-Link Job to run the assemble CICS Map Source Code into Physical Map and Symbolic Map respectively. You should change the parameter values in the JCL Stream, to suit your needs and then run the Job.

Q. How do you define and Install the Map in CICS?
To display and see the output of your Map on the Terminal Emulator, CICS Software needs to pick up your Physical Map(Load Module) from the Disk and load it into the Main Storage. To help CICS Software find your Load Module, you must add the appropriate entries in the CICS Tables.

First, use the CEDA Transaction define a new mapset.


Enter the Mapset Name INQSET1, with Group-name MYGROUP.


Second, use the CEDA Transaction to install the mapset.


Enter the Mapset name as INQSET1.


Enter the Group-name as MYGROUP.


In a similar fashion, you need to DEFINE and INSTALL your Program INQSET1. Remember, that ultimately a MAP is also a Program. So, you need to
Q. How to display the Map on the CICS Terminal?
Whenever you want to send anything to the CICS Terminal, you can use the special CICS Command SEND MAP. CICS provides a set of commands to you, called the Terminal Control Commands. When you want to send data to any terminal, you can use the CICS Command SEND MAP. On the same lines, when you want to receive data from the terminal, you can use the CICS Command RECEIVE MAP.

We want display the Map INQMAP1, within the Mapset INQSET1. Type the command CECI SEND MAP('INQMAP1') MAPSET('INQSET1') and hit Enter.


You should get a warning message, "About to Execute Command". Hit Enter once more.


After you press Enter, you should be able to see the Output of your Map on the CICS Terminal.


To many people who are thrown to work at a mainframe computer on their first job, they feel lost. Mainframe people seem to speak a completely different language and that doesn't make life easy. What's more, the books and manuals are incredibly hard to comprehend.

"What on earth is a Mainframe?" is an absolute beginner's guide to mainframe computers. We'll introduce you to the hardware and peripherals. We'll talk about the operating system, the software installed on a mainframe. We'll also talk about the different people who work on a mainframe. In a nutshell, we'll de-mystify the mainframe.

Readers based in India, can buy the e-book for Rs. 50 only or the print book. International readers based in the US and other countries can click here to purchase the e-book.