RECEIVE MAP


The RECEIVE MAP command is used to retrieve input data entered by a user on a 3270 terminal screen. This command is commonly used in COBOL CICS programs to receive user input from a screen formatted using Basic Mapping Support (BMS).

Purpose -

  • Captures user-entered data from an unprotected field in a BMS map.
  • Transfers input into a COBOL program for processing.
  • Facilitates interactive transactions in CICS applications.
  • Works together with the SEND MAP command, which first sends the screen to the user.

Syntax -

EXEC CICS 
	RECEIVE MAP(map-name)
     MAPSET(mapset-name)
     INTO(data-area)
     LENGTH(data-area-length)
	 TERMINAL
	 ASIS
     RESP(response-variable)
	 RESP2(response2-variable)
END-EXEC.
  • MAP(map-name) - specifies the map name from which input is received.
  • 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).
  • INTO(data-area) - Optional. specifies the data area where the received data needs to be written. If INTO is not coded, then CICS automatically finds the symbolic map area for the MAP and places the data in the corresponding input fields. The fields can be referred to in the program by referring to fieldname+I.
  • LENGTH (symbolic-map-area-length) - Optional. It specifies the length of the data. The receiving data area length should not exceed the length of the mapped data area.
  • TERMINAL - Optional. Specifies the data needs to be read from the terminal that initiated the transaction. TERMINAL is mandatory if INTO and LENGTH are not specified.
  • ASIS - Optional. Indicates that the data entered on the screen will remain in its original case. This allows the current task to receive messages containing both uppercase and lowercase characters from the map.
  • RESP(response-variable) - Optional. It captures the response code of the RECEIVE 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 - Receiving data from customer inquiry screen with predefined fields.

  • Map: CUSTINQ
  • Mapset: CUSTMAPS
EXEC CICS RECEIVE
         MAP('CUSTINQ')
         MAPSET('CUSTMAPS')
		 INTO(CUSTINQI)
         RESP(RESP-CODE)
END-EXEC.

Explanation -

  • MAP('CUSTINQ'): Specifies the map from where it received.
  • MAPSET('CUSTMAPS'): Refers to the mapset containing the map.
  • FROM(CUSTINQO): Specifies the map layout used to receive the data from the screen.
  • RESP(RESP-CODE): Captures the response code to check for errors.

Error Conditions -


Eror Condition RESP RESP2 Reason
INVREQ 16 Occurs if a RECEIVE MAP command is issued in a non-terminal task.
MAPFAIL 36 Occurs if the data mapped has a length of zero or does not contain a set-buffer-address sequence. This condition arises if a program issues a RECEIVE MAP command to the terminal where the operator responds by pressing a CLEAR or PA key, or by pressing ENTER or a function key without entering data.
INVMPSZ 38 Occurs if the specified map is too wide or too long for the terminal.