How can we code a program such that we will never get a
MAPFAIL error?

Answer Posted / rakesh

Normally MAPFAIL just indicates that no data has ben entered in any of the fields, and thus the MDT-bit is not set in the fileds attribute-byte. CICS issues a "Read Modified" 3270-command, and receives data from fields that has the MDT-bit set. When you get MAPFAIL, this just tells you that no field has been modified, an really is "normal".
In program logic you have to check if data has been entered in mandatory fileds. The result may vary, and is a result of users action. Zero or many fileds may have been modified.
In your program logic you should FIRST check for invalid PF/PA/Clear-keys, and ONLY do a Receive Map after the check. There is no need to do a Receive Map if the user pressed the Clear or a PA-key, as an example. The EIBAID contains the value for the key pressed to initiate this pseudoconversation - even without a Receive Map.
If you use Resp Option, coding RESP(ws-variable) in your Receive Map, you can eliminate the Mapfail problem.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the cics command that is used for reading a record from the tdq?

551


How do we pass parameters into a CICS –DB2 program

3649


Define an asra abend?

602


Can you define attribute byte?

580


What is meant by a ‘Transid’ ?

630






What is the difference between SEND MAP DATAONLY and SEND MAP MAPONLY ?

718


What Are Send Map Maponly & Send Map Dataonly ?

704


what are the differences between temporary storage queue (tsq) and transient data quene (tdq)?

682


What is the comaera (communication area)?

638


which is the cics control program that provides communication services between user written application programs and terminals?

561


specify the requirements for automatic task initiation. (Mention the control table, it is entries and the corresponding procedure division cics command).?

694


Highlight the points of differences between XCTL and START?

633


Mention the option used in a cics command to retrieve the response code after execution of the command?

639


What are the ways fot initiating a transaction?

555


how can you prevent more than one user from accessing the same transient data queue?

606