SEND MAP


The SEND MAP command is used to display formatted output on a terminal. It sends a predefined screen layout (map) created using BMS (Basic Mapping Support) to the user’s terminal. Before executing the SEND command, the application program must prepare the data in the symbolic map area.

Purpose -

  • To present data or messages to the user in a predefined format.
  • To create user interfaces with consistent layout and style.

Syntax -

EXEC CICS SEND
     MAP(map-name)
     MAPSET(mapset-name)
	 FROM (symbolic-map-area)
	 LENGTH (symbolic-map-area-length)
     DATAONLY|MAPONLY
     CURSOR(cursor-position)
     ERASE
	 PRINT|FREEKB|ALARM|FRSET
     RESP(response-variable)
	 RESP2(response2-variable)
END-EXEC.
  • MAP(map-name) - specifies the map name which needs to be display on the terminal.
  • MAPSET(mapset-name) - Optional when map name coded. It specifies the mapset name that contains the map. A mapset can have multiple maps. Mapset should be defined in Program Processing Table (PPT).
  • FROM(symbolic-map-area) - Optional. It contains the data to be passed to map. If the FROM parameter is not coded, CICS automatically locates the corresponding symbolic map area (mapnameO) and sends it to the terminal.
  • LENGTH (symbolic-map-area-length) - Optional. It specifies the length of the data. The sending data area length should not exceed the length of the mapped data area.
  • DATAONLY - Optional. It sends only the data fields of the map without the formatting or labels. It is used to update data on the screen without overwriting the static parts of the map.
  • MAPONLY - Optional. It specifies only default MAP data to be written to the screen. If the MAPONLY option is coded, FROM option is not required. If MAPONLY coded along with FROM, FROM option will be ignored.
  • CURSOR(cursor-position) - Optional. It specifies the cursor's position on the terminal after the map is displayed. If no value is coded, then the cursor will be positioned at the first unprotected field of the MAP.
  • ERASE - Optional. Clears the screen before displaying the map. It is responsible for the below three tasks -
    • Erases the screen buffer before sending the map to the screen.
    • Erases the screen print buffer before sending the map to the screen.
    • Place the cursor on the upper left corner of the MAP before sending the map to the screen.
  • PRINT - Optional. This option specifies that map printing should be initiated at the printer.
  • FREEKB - Optional. This option indicates that the keyboard should be unlocked after the data has been written. If the FREEKB option is not used, the keyboard will remain locked.
  • ALARM - Optional. This option activates the audible alarm feature of the 3270.
  • FRSET - Optional. This option specifies that the modified data tags (MDTs) of all fields should be reset to their unmodified state before any map data is written to the buffer.
  • RESP(response-variable) - Optional. It captures the response code of the SEND MAP operation and used to check if the command executed successfully or encountered an error.
  • RESP2(response2-variable) - Optional. It captures the response2 code of the RECEIVE MAP operation when the error occured.

Short Examples -


Scenario - Displaying a customer inquiry screen with predefined fields for input and output.

  • Map: CUSTINQ
  • Mapset: CUSTMAPS
EXEC CICS SEND
     MAP('CUSTINQ')
     MAPSET('CUSTMAPS')
	 FROM(CUSTINQO)
     ERASE
     CURSOR(10)
     RESP(RESP-CODE)
END-EXEC.

Explanation -

  • MAP('CUSTINQ'): Specifies the map to display.
  • MAPSET('CUSTMAPS'): Refers to the mapset containing the map.
  • FROM(CUSTINQO): Specifies the map layout used to send the data to the screen.
  • ERASE: Clears the screen before displaying the map.
  • CURSOR(10): Places the cursor at position 10 after the map is displayed.
  • RESP(RESP-CODE): Captures the response code to check for errors.

Error Conditions -


Eror Condition RESP RESP2 Reason
INVREQ 16 200 Command not allowed for a distributed program link server program.
RETPAGE 32 Occurs if the SET option is specified and a completed page is ready for return to the application program.
TSIOERR 35 Occurs if there is an irrecoverable temporary storage input/output error.
INVMPSZ 38 Occurs if the specified map is too wide for the terminal.
IGREQID 39 Occurs if the prefix specified in the REQID option is different from previous REQID option.
OVERFLOW 40 Occurs if the mapped data does not fit on the current page. This condition is only raised if a HANDLE CONDITION OVERFLOW command is active.